Commit graph

5 commits

Author SHA1 Message Date
TonyBlu
33e6ae3388 fix: clear() deletes chapter/subtitle files + persist subtitle_files
Bug fixes from full codebase review:
- clear() with DELETE_FILE_ON_TRASHCAN now also deletes chapter_files
  and subtitle_files, not just the primary filename
- _PERSISTED_DOWNLOAD_FIELDS now includes 'subtitle_files' so subtitle
  file info survives app restart

Tests:
- Added test_subtitle_lang_list_with_region_variant_input (zh-Hans)
- Added test_subtitle_lang_list_dedup_region_variant (pt-BR)
2026-05-25 21:51:37 +08:00
TonyBlu
6d890021a6 feat(captions): P1/P2 improvements - region variant fallback, DownloadInfo init, subtitle_files UI
P1 fixes:
- _subtitle_lang_list now extracts base language from qualified tags
  (e.g. zh-Hans → zh base) so regional variants are still added as
  fallbacks. Original input is preserved as first priority.
- DownloadInfo.__init__ now explicitly initializes filename=None and
  chapter_files=[] to avoid AttributeError on dynamic attribute access.
- __setstate__ adds filename=None migration for old persistent data.
- Frontend Download interface gains subtitle_files field; completed
  downloads show each subtitle file with download link and CC icon.

P2 improvements:
- _LANGUAGE_REGION_VARIANTS expanded from 10 to 30 languages covering
  it/ja/ko/hi/th/vi/id/pl/uk/ru/cs/sv/da/no/fi/tr/el/he/hu/bn/ta.
- Languages with no regional variants use empty tuple (they still get
  -orig suffix when include_orig=True).
2026-05-25 21:48:27 +08:00
TonyBlu
b31f4e2fea fix(tests): update subtitle language list assertions for variant fallback
Update test expectations to match the new _subtitle_lang_list() output
which includes regional variants (e.g. fr-FR, en-GB) for better
subtitle matching.
2026-05-25 21:27:10 +08:00
Alex Shnitman
a1f2fe3e73 implement tests 2026-03-20 13:12:31 +02:00
Alex Shnitman
7fa1fc7938 code review fixes 2026-03-15 20:53:13 +02:00