spotube/lib/provider
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
..
audio_player chore: fix alternative sources not persisting 2025-11-14 16:17:37 +06:00
connect refactor: move from Track to SpotubeTrackObject and use TrackSources object for providers 2025-06-18 21:30:32 +06:00
database refactor(preferences): use Drift sql db for preferences 2024-06-14 00:29:09 +06:00
glance fix: local playback not working for tracks with special # (hashtag) characters 2025-08-31 00:45:29 +06:00
history chore: remove useless dependencies 2025-11-13 14:57:08 +06:00
local_tracks fix: local track not working and images of local not showing up 2025-08-16 16:11:04 +06:00
logs chore: fix logs not showing up and nightly crashing on track change on android 2025-01-26 22:05:24 +06:00
lyrics fix: lyrics not working 2026-02-24 18:36:29 +06:00
metadata_plugin chore: fix alternative sources not persisting 2025-11-14 16:17:37 +06:00
scrobbler feat: add plugin scrobbling support and support button 2025-08-01 22:18:29 +06:00
server fix(server): race condition and cache corruption in playback routes 2026-07-26 10:39:07 +02:00
skip_segments feat: move away from track source query and preferences audio quality and codec 2025-11-03 19:33:47 +06:00
track_options chore: fix alternative sources not persisting 2025-11-14 16:17:37 +06:00
tray_manager chore: optimize assets and app size 2025-08-29 17:33:54 +06:00
user_preferences feat: move away from track source query and preferences audio quality and codec 2025-11-03 19:33:47 +06:00
youtube_engine feat: implement yt-dlp for desktop and NewPipeExtractor for Android (#2316) 2025-02-11 21:36:07 +06:00
blacklist_provider.dart refactor: remove old spotify.dart types and custom spotube metadata types 2025-06-19 14:42:29 +06:00
discord_provider.dart feat: remove green corp names formally 2025-06-19 23:04:24 +06:00
download_manager_provider.dart fix: download not working in different devices and slow 2025-11-11 10:39:13 +06:00
sleep_timer_provider.dart refactor: rename providers 2024-04-12 11:06:03 +06:00
volume_provider.dart chore: fix volume not being set after launch 2024-06-25 20:38:40 +06:00