[BUG]: Retimed subtitle files are keyed only by provider + id — season-pack subtitles may show the previous episode's text

Aperta Adatta ai principianti
#931 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
android, kotlin
Ambito
mobile

Direzione di ricerca

Parti da localizeSubtitle() in PlayerViewModel, dove il sottotitolo abbinato/ritemporizzato viene scritto in cacheDir/matched_subs e il suo nome file è costruito da "${sub.provider}|${sub.id}".hashCode() più #retimed. Aggiungi al nome un hash del contenuto del sottotitolo, così testi diversi non riutilizzano mai un URI, e verifica che la pulizia esistente a 40 file in quella stessa directory continui a limitarlo. È completato quando due episodi che condividono un id di season pack ottengono file distinti e il secondo episodio mostra le proprie righe; i passaggi di riproduzione su un season pack sono il controllo, dato che nell'issue non è indicato alcun test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type:bug
Describe the Bug

Retimed/matched subtitle files are keyed only by provider + id, so a season-pack subtitle that has the same id in every episode can show the previous episode's text.

localizeSubtitle() in PlayerViewModel writes a matched or retimed subtitle to cacheDir/matched_subs with a file name built only from "${sub.provider}|${sub.id}".hashCode() (plus #retimed for audio-synced copies). The player then loads that file:// URI through the CacheDataSource backed by mediaCache, which keys on the URI.

Some addons (SubSource in my case) return season-pack subtitles with the same id in every episode. When the same pack subtitle is matched or retimed in E01 and then in E02, E02's file is written to the same path → same URI → the cache can serve E01's content while E02 is playing. The cache is on disk, so it survives between sessions.

Steps to Reproduce
  1. Play E01 of a series whose subtitle comes from a season pack with the same id in every episode (here: SubSource "Rise of the Nazis S01 (2019) WEB-DL Cinefeel_2").
  2. Let the subtitle be matched/retimed (audio sync).
  3. Play E02 and let the same subtitle be retimed again.
  4. The retimed subtitle shown in E02 carries E01's lines (the original, non-retimed subtitle is correct, because its URI is different).

Note: I saw this in my personal fork of ARVIO, where the retimed copy is also used as the AI translation source, so E01's lines were translated during E02. I have not reproduced it in stock ARVIO, but the same localizeSubtitle() path is used whenever stock ARVIO retimes or matches a subtitle.

Expected Behavior

Each episode's retimed subtitle uses its own file. Suggested one-line fix — include the content in the file name, so a different text never reuses a URI:

val file = java.io.File(dir, "${"${sub.provider}|${sub.id}".hashCode().toUInt()}-${raw.hashCode().toUInt()}.$ext")

The existing "keep the last 40 files" cleanup still bounds the directory. This fixed it in my fork.

Screenshots / Video

—


Environment & Device Information
  • Android TV / Google TV / Fire TV
    • Device Model: Dune HD Homatics Box R 4K Plus
    • OS / Firmware: Android TV (Dune HD firmware)
    • App Version: personal fork based on current ARVIO (galinosT/ARVIO)
    • Install Source: GitHub Releases APK (fork)

Affected Component / Feature
  • Subtitles / Audio (Subtitle sync, missing tracks, AI subtitles)

Media & Playback Details
  • Source Type: Addon/Debrid (AIOStreams → TorBox); subtitles from SubSource / SubDL / OpenSubtitles addons
  • Stream Format / Codecs: 1080p AMZN WEB-DL, H.264, DD+ 2.0, no embedded subtitles
  • Player Settings: default
Crash Logs / Logcat

—

Lingua principale
Kotlin
Stelle
760
Fork
122
Merge medio
22h 38m
PR unite (30g)
80

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ProdigyV21/ARVIO

Tutte le issue di ProdigyV21/ARVIO

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.