unarr/internal/library
Deivid Soto d708ea2360 feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid
Close the recurring "video has subtitles but the web player shows none" gap
with a source-agnostic pipeline:

- Discover EXTERNAL sidecar subs in the scan (Video.es.ass siblings + a Subs/
  bundle), parse lang/forced/SDH from the filename, skip VobSub (.sub+.idx).
  ffprobe-only scanning ignored these (ToonsHub/anime "MSubs" releases).
- Transcode sidecar charset -> UTF-8 before WebVTT (BOM/UTF-16/code-page by
  language). Chinese SCRIPT matters: chs/sc -> GBK, cht/tc/big5 -> Big5
  (decoding one as the other is mojibake).
- /sub now serves a standalone sidecar file (i=-1, p=file, &l=lang hint) and a
  remote debrid URL (ffmpeg reads http, no local stat) — not just embedded
  streams of a local file.
- probe.json emits a tokened vttUrl per TEXT track so torrent/debrid HLS streams
  (never library-scanned) get subtitles too. Embedded index is counted among
  embedded streams only, so -map 0:s:N stays aligned when sidecars are appended.

Tested against a real 347-file gallery: 26/26 sidecars and embedded ass/srt/
mov_text all extract to valid WebVTT; bitmap (pgs/dvd_subtitle) correctly stays
burn-in. Manual harness gated behind GALLERY_DIR.
2026-06-08 13:04:09 +02:00
..
mediainfo feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
cache.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
cache_test.go feat: add migrate command, media server detection, and debrid auto-config 2026-03-29 16:54:32 +02:00
delete.go feat(library): add server-driven file deletion with allow_delete config 2026-04-10 16:35:12 +02:00
delete_test.go feat(library): add server-driven file deletion with allow_delete config 2026-04-10 16:35:12 +02:00
fingerprint.go feat(library): content fingerprint + path-resilient sync + stream self-heal 2026-06-03 12:08:58 +02:00
fingerprint_test.go feat(library): content fingerprint + path-resilient sync + stream self-heal 2026-06-03 12:08:58 +02:00
loadgate_test.go fix(trickplay): stop scan-time sprite generation from saturating the host 2026-06-04 08:25:00 +02:00
paths.go feat(scan): always scan downloads + organize dirs, deduplicate child paths 2026-04-10 11:46:20 +02:00
prewarm.go fix(trickplay): stop scan-time sprite generation from saturating the host 2026-06-04 08:25:00 +02:00
prewarm_test.go fix(stream): /critico review fixes for the sidecar cache 2026-06-02 13:46:07 +02:00
resolve.go fix(library): classify resolution by width + height, not height alone 2026-05-27 11:54:29 +02:00
resolve_test.go fix(library): classify resolution by width + height, not height alone 2026-05-27 11:54:29 +02:00
scanner.go feat(library): content fingerprint + path-resilient sync + stream self-heal 2026-06-03 12:08:58 +02:00
scanner_test.go feat(cli): upgrade command, rich status, and version cache 2026-03-31 22:05:43 +02:00
sync.go feat(library): content fingerprint + path-resilient sync + stream self-heal 2026-06-03 12:08:58 +02:00
sync_test.go feat(cli): upgrade command, rich status, and version cache 2026-03-31 22:05:43 +02:00
types.go feat(library): content fingerprint + path-resilient sync + stream self-heal 2026-06-03 12:08:58 +02:00