spotube/lib
Tomasz Jabłonowski 19adaf5e54 fix(server): race condition and cache corruption in playback routes
Two related bugs in ServerPlaybackRoutes:

1. _getSourcedTrack looked up the requested media in
   audioPlayer.playlist.medias by URI, but MPV issues its HTTP request
   before media_kit's Dart-side state has synced with the native
   player, so the lookup threw "Bad state: No element" and the proxy
   returned 500 ("Failed to open" in MPV). Now resolves the track
   directly from playlist.tracks by trackId via firstWhereOrNull,
   independent of the player's media list.

2. MPV opens multiple concurrent range requests for the same track
   (buffering/seek/reconnect), each opening its own writeOnlyAppend
   sink to the same .part cache file; the final rename would then fail
   with a file-in-use error (or corrupt the cache from concurrent
   appends). Added a _cachingInProgress guard so only one request
   caches a given track at a time, cache only full requests
   (contentRange.start == 0), write with truncate instead of append,
   and clean up the in-progress marker/partial file in finally.

Fixes #3089
2026-07-26 10:39:07 +02:00
..
collections fix: downloaded tracks are not tagged with metadata 2025-11-08 15:49:37 +06:00
components fix: download not working in different devices and slow 2025-11-11 10:39:13 +06:00
extensions fix: download not working in different devices and slow 2025-11-11 10:39:13 +06:00
hooks chore: re-enable endless playback 2025-07-19 11:56:51 +06:00
l10n chore: bump version and generate CHANGELOG 2025-11-14 13:36:20 +06:00
models Release 5.1.2+45 (#3049) 2026-06-05 10:49:09 +06:00
modules chore: fix alternative sources not persisting 2025-11-14 16:17:37 +06:00
pages Release 5.1.2+45 (#3049) 2026-06-05 10:49:09 +06:00
provider fix(server): race condition and cache corruption in playback routes 2026-07-26 10:39:07 +02:00
services Release 5.1.2+45 (#3049) 2026-06-05 10:49:09 +06:00
utils feat: move away from track source query and preferences audio quality and codec 2025-11-03 19:33:47 +06:00
generated_plugin_registrant.dart Playlist info editing (#708) 2023-09-10 16:39:21 +06:00
main.dart feat: add NewPipe support for desktop platforms 2025-11-07 18:48:18 +06:00