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

Đang mở Phù hợp với người mới
#931 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu từ localizeSubtitle() trong PlayerViewModel, nơi phụ đề đã khớp/căn chỉnh lại thời gian được ghi vào cacheDir/matched_subs và tên tệp của nó được tạo từ "${sub.provider}|${sub.id}".hashCode() cộng với #retimed. Thêm vào tên một hash của nội dung phụ đề để nội dung khác nhau không bao giờ tái sử dụng cùng một URI, và xác nhận rằng việc dọn dẹp hiện có giới hạn 40 tệp trong cùng thư mục đó vẫn hoạt động. Hoàn thành khi hai tập có chung id season pack nhận được các tệp riêng biệt và tập thứ hai hiển thị đúng các dòng của chính nó; các bước tái tạo trên một season pack là phần kiểm tra, vì issue không nêu tên bài test nào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

—

Ngôn ngữ chính
Kotlin
Star
760
Fork
122
Merge trung bình
22 giờ 38 phút
Pull request đã merge (30 ngày)
80

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ProdigyV21/ARVIO

Tất cả issue của ProdigyV21/ARVIO

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.