From 4a6f6870c4fa39ebd67000e17de9e716bbce5fad Mon Sep 17 00:00:00 2001 From: facundo Date: Mon, 24 Jun 2024 14:00:40 -0300 Subject: [PATCH] populate user_url for mastodon --- feedi/parsers/mastodon.py | 3 ++- feedi/templates/entry_avatar.html | 2 +- feedi/templates/entry_header.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/feedi/parsers/mastodon.py b/feedi/parsers/mastodon.py index f36a94b..91ac88d 100644 --- a/feedi/parsers/mastodon.py +++ b/feedi/parsers/mastodon.py @@ -70,7 +70,7 @@ def fetch_toots(server_url, access_token, newer_than=None, limit=None): if toot.get('reblog'): reblogged_by = display_name(toot) - entry['header'] = f' { reblogged_by } boosted' + entry['header'] = f' {reblogged_by} boosted' toot = toot['reblog'] entry['avatar_url'] = toot['account']['avatar'] @@ -87,6 +87,7 @@ def fetch_toots(server_url, access_token, newer_than=None, limit=None): # use server-local urls entry['target_url'] = status_url(server_url, toot) entry['comments_url'] = entry['target_url'] + entry['user_url'] = user_url(server_url, toot) # for media we only support images for now and will take just the first one media = [m['preview_url'] for m in toot['media_attachments'] if m['type'] == 'image'] diff --git a/feedi/templates/entry_avatar.html b/feedi/templates/entry_avatar.html index dafca4e..8218340 100644 --- a/feedi/templates/entry_avatar.html +++ b/feedi/templates/entry_avatar.html @@ -1,5 +1,5 @@ {% if entry.avatar_url %} - + {{ entry.username }} {% elif entry.feed %} diff --git a/feedi/templates/entry_header.html b/feedi/templates/entry_header.html index 5c54e7b..5775a2d 100644 --- a/feedi/templates/entry_header.html +++ b/feedi/templates/entry_header.html @@ -17,7 +17,7 @@ {% if entry.target_url %}href="{{ entry.target_url }}" target="_blank"{% endif %} >{{ entry.title | safe }} {% elif entry.has_distinct_user %} - + {{ entry.display_name or entry.username }} {% else %}