Skip to content

Cancel superseded native-queue downloads #491

Description

@LargeModGames

Is your feature request related to a problem? Please describe.
play_queued_subsonic, play_queued_qobuz, and play_queued_youtube in src/infra/queue/dispatch.rs detach their download task and keep no handle. A skip republishes the queue slot, but the old download runs to completion; the stale result is discarded by the fetch_id check only when it lands. Fast skips through hi-res Qobuz tracks keep several downloads and tempfile writes alive at the same time.

Describe the solution you'd like
An abort handle on DecodedQueuePlayback, stored under the same lock that stamps fetch_id, and aborted whenever the slot is republished or cleared. One change covers all three lanes. Add a regression test for a skip during a pending download.

Describe alternatives you've considered
Keeping the current behaviour: correct, but it wastes bandwidth and disk on every fast skip.

Additional context
Raised by CodeRabbit on #489; I deferred it there because the fix belongs to the shared queue engine, not to one source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions