From 1c1e130aefbeac8b14a213445c399ff939f51bd9 Mon Sep 17 00:00:00 2001 From: Sleeps Date: Thu, 8 Oct 2026 22:24:05 +0100 Subject: [PATCH] Sort caption text export by generated timestamp and display it --- scripts/show_captions.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/show_captions.sh b/scripts/show_captions.sh index 47b460a..aecbad9 100755 --- a/scripts/show_captions.sh +++ b/scripts/show_captions.sh @@ -20,7 +20,7 @@ con.row_factory = sqlite3.Row try: rows = con.execute(""" SELECT m.title, m.jellyfin_item_id, - cw.start_ms AS timestamp_ms, cw.caption + cw.start_ms AS timestamp_ms, cw.caption, cw.captioned_at AS generated_at FROM caption_windows cw JOIN media m ON m.id = cw.media_id WHERE cw.caption IS NOT NULL AND TRIM(cw.caption) != '' @@ -28,12 +28,12 @@ try: UNION ALL SELECT m.title, m.jellyfin_item_id, - f.timestamp_ms, f.caption + f.timestamp_ms, f.caption, f.captioned_at AS generated_at FROM frames f JOIN media m ON m.id = f.media_id WHERE f.caption IS NOT NULL AND TRIM(f.caption) != '' - ORDER BY title, timestamp_ms + ORDER BY generated_at DESC NULLS LAST, title, timestamp_ms """) for row in rows: @@ -45,6 +45,7 @@ try: print(f"{row['title']} [{timestamp}]") print(f"Jellyfin ID: {row['jellyfin_item_id']}") + print(f"Generated at (UTC): {row['generated_at'] or 'Unknown'}") print(f"Caption: {caption}") print() finally: