mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-16 23:11:27 +00:00
Merge pull request #48 from MrSleeps/feature/caption-export-generated-timestamps
Include caption generation times and sort caption text export newest first
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user