Skip to content

Qobuz: repeat-one and queue resume can replay a partial tempfile #490

Description

@LargeModGames

Describe the bug
The Qobuz session keeps the FLAC tempfile that stream-download fills while a track plays, and replays that file for repeat-one (ReplayCurrentTrack) and for the native-queue resume (resume_qobuz). The file is whole only when the reader consumed every byte. Two paths leave it incomplete: a forward seek skips a range that is backfilled only after the tail, and the download is cancelled when the sink drops the reader at the end of the track; a queue takeover mid-download cancels the download outright. The replay then plays a silent hole or ends early, and the resume seek can land past the end of the file.

To Reproduce

  1. Play a long hi-res Qobuz track with repeat-one on.
  2. Seek forward to near the end and let the track finish.
  3. The replay has a silent hole, or ends early and trips auto-advance.

Or: play a Qobuz track, Enter-jump onto a queued item after 20 s on a slow link, and let the queue drain. The resume plays a truncated file.

Expected behavior
Replay from the tempfile only when the file is complete; otherwise fetch the track again.

Screenshots
None.

Desktop (please complete the following information):

Additional context
Two ways to fix it: always fetch again on replay and resume (simple, one extra download per repeat loop), or a range-coverage writer in TempfileStorage (src/infra/qobuz/stream/progressive.rs) that records the written ranges so the session knows when the file is whole. Found in the review of #489.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions