From 2a2ff0749f18670ab82c304c8c3468aeea47846f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 4 Sep 2025 14:07:47 -0400 Subject: Add Default Titles for Queue Items Implement a migration to add default titles to queue items with NULL titles. This ensures that every queue item has a meaningful title, improving user experience and data consistency. The migration updates items with 'Untitled Article' when no title is present. --- Biz/PodcastItLater/Web.py | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'Biz/PodcastItLater/Web.py') diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index 3a6d06c..6770d33 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -869,9 +869,11 @@ class AdminView(Component[AnyChildren, AdminViewAttrs]): ), html.td( html.div( - item.get( - "title", - "-", + ( + item.get( + "title", + ) + or "-" )[ :TITLE_TRUNCATE_LENGTH ] @@ -1851,8 +1853,29 @@ def admin_queue_status(request: Request) -> AdminView | Response | html.div: ), title=item["url"], style={ - "max-width": ("300px"), - "overflow": ("hidden"), + "max-width": "300px", + "overflow": "hidden", + "text-overflow": "ellipsis", + }, + ), + style={"padding": "10px"}, + ), + html.td( + html.div( + (item.get("title") or "-")[ + :TITLE_TRUNCATE_LENGTH + ] + + ( + "..." + if item.get("title") + and len(item["title"]) + > TITLE_TRUNCATE_LENGTH + else "" + ), + title=item.get("title", ""), + style={ + "max-width": "200px", + "overflow": "hidden", "text-overflow": "ellipsis", }, ), -- cgit v1.2.3