feat: genericized show

This commit is contained in:
Kat Inskip 2025-02-28 00:33:43 -08:00
parent e9d89011f7
commit 7657c18f7d
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
3 changed files with 4 additions and 2 deletions

View file

@ -92,7 +92,7 @@ class Konawall(wx.adv.TaskBarIcon):
def open_url(self, evt=None):
for post in self.current:
subprocess.call(["xdg-open", f'https://konachan.com/post/show/{post["id"]}'])
subprocess.call(["xdg-open", post["show_url"])
def open_log(self, evt=None):
subprocess.call(["xdg-open", self.log_path])

View file

@ -38,8 +38,9 @@ def request_posts(count: int, tags: list, config) -> list:
kv_print("Rating", post["rating"])
kv_print("Resolution", f"{post['file']['width']}x{post['file']['height']}")
kv_print("Tags", post["tags"])
kv_print("URL", post["file"]["url"])
kv_print("URL", post["file"]["url"])i
# Append the URL to the list
post["show_url"] = f"https://e621.net/posts/{post['id']}"
posts.append(post)
else:
# Raise an exception if the request failed

View file

@ -38,6 +38,7 @@ def request_posts(count: int, tags: list, config={}) -> list:
kv_print("Resolution", f"{post['width']}x{post['height']}")
kv_print("Tags", post["tags"])
kv_print("URL", post["file_url"])
post["show_url"] = f"https://konachan.com/post/show/{post["id"]}"
# Append the URL to the list
posts.append(post)
else: