IMPROVED VERSION: Show media attachments in the "L" list of links

pull/235/head
Peter Fidelman 2022-04-13 21:33:58 -07:00 zatwierdzone przez Ivan Habunek
rodzic 12d682591b
commit 0d20a4878b
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -325,6 +325,11 @@ class TUI(urwid.Frame):
def show_links(self, status):
links = parse_content_links(status.data["content"]) if status else []
post_attachments = status.data["media_attachments"] or []
reblog_attachments = (status.data["reblog"]["media_attachments"] if status.data["reblog"] else None) or []
for a in post_attachments + reblog_attachments:
url = a["remote_url"] or a["url"]
links.append((url, a["description"] if a["description"] else url))
if links:
self.open_overlay(
widget=StatusLinks(links),