Commit Graph

30 Commits

Author SHA1 Message Date
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
Kingkor Roy Tirtho
3f5291ec92 chore: upgrade hetu_std 2025-11-14 13:09:46 +06:00
Kingkor Roy Tirtho
6884a131c9 fix(playback): use stream instead of chunked serving of audio bytes 2025-11-12 14:35:06 +06:00
Kingkor Roy Tirtho
3209c75144 fix: downloaded tracks are not tagged with metadata 2025-11-08 15:49:37 +06:00
Kingkor Roy Tirtho
6272f376ea fix: quality preset initialization fails and audio source auth 2025-11-04 12:02:10 +06:00
Kingkor Roy Tirtho
6311831902 feat: move away from track source query and preferences audio quality and codec 2025-11-03 19:33:47 +06:00
Kingkor Roy Tirtho
99a84aa6dc chore: create sourced track from active audio source plugin 2025-11-03 13:32:48 +06:00
Kingkor Roy Tirtho
3e34bc4be6 chore: streaming issue for mp3 2025-09-19 21:40:26 +06:00
Kingkor Roy Tirtho
cecb687592 feat(playback): add uncompressed flac playback support 2025-09-19 11:53:36 +06:00
Kingkor Roy Tirtho
e8a54d3209 feat(playback): add dab music source 2025-09-19 10:31:49 +06:00
Kingkor Roy Tirtho
469a76dbd6 fix: yt-dlp playback not working and add partial support for HLS streaming 2025-09-05 22:40:18 +06:00
Kingkor Roy Tirtho
f870e12011 fix(playback): skip network requests if cached file already exists 2025-09-05 11:03:56 +06:00
Kingkor Roy Tirtho
ea329f40e8 fix(yt): fallback to different search result if all streaming url is inaccessible 2025-09-02 20:56:28 +06:00
Kingkor Roy Tirtho
e2c0ddef24 fix: inaccessible streaming url causing rapid skips
Now it filters the inaccessible streaming urls out so weird stuff won't happen
2025-09-02 20:10:02 +06:00
Kingkor Roy Tirtho
60f032039f fix: endless playback not working 2025-07-19 13:58:05 +06:00
Kingkor Roy Tirtho
53ad5bd448 feat: remove green corp names formally 2025-06-19 23:04:24 +06:00
Kingkor Roy Tirtho
4e6db8b9e1 refactor: move from Track to SpotubeTrackObject and use TrackSources object for providers 2025-06-18 21:30:32 +06:00
Kingkor Roy Tirtho
7c26d29d06 fix: remote path traversal through websocket when devices are on same network 2025-04-27 20:30:32 +06:00
Kingkor Roy Tirtho
b74c2eab8f fix: calling /track/:streamId endpoint causes active sourced track to be anything 2025-03-28 20:57:46 +06:00
Kingkor Roy Tirtho
677f95f266 fix: youtube_explode_dart failing for many videos due to youtube ios client visitor data change 2025-03-05 22:13:42 +06:00
Kingkor Roy Tirtho
1e6d709e04
feat: implement yt-dlp for desktop and NewPipeExtractor for Android (#2316)
* feat: add youtube engine abstraction and yt-dlp integration

* chore: add yt-dlp as optional dependency

* feat: implement custom path support for youtube engines

* chore: check for custom path in setting engine select dropdown

* chore: update yt_dlp_dart

* chore: setting video url instead of video id in fetchSiblings

* feat: implement NewPipe engine

* chore: update local path to git url for flutter_new_pipe_extractor package

* chore: fix android build isn't working

* chore: fix routes not working when initially signing in

* refactor: drop fallback support to different sources
2025-02-11 21:36:07 +06:00
Kingkor Roy Tirtho
698fb6ba27 fix: youtube tracks keeps skipping despite being matched correctly 2025-02-05 00:36:23 +06:00
Kingkor Roy Tirtho
b52bf0f448
feat(android): home widget support (#2148)
* feat: add android home widget support

* feat: style widget player and add intent and callbacks on action

* feat: responsive and working android home widget

* fix(android): models stripping causing it to not work for release apks

* chore: ios lockfile update

* feat: config for iOS widget

* cd: upgrade xcode

* cd: reduce xcode version

* feat: add a christmas background
2024-12-16 22:47:44 +06:00
Kingkor Roy Tirtho
8ca2115ef0
feat: track caching and cached track export support (#2117)
* feat: add caching support with track metadata

* feat(settings): add cache music toggle

* fix(mobile): cache dir not open-able

* feat(local folder): add cache export/clear actions and size of the folder

* chore: ios deps upgrades

* chore: upgrade lint flutter version

* chore: lint secrets causing error

* cd: invalid value for env var
2024-12-08 20:03:01 +06:00
Kingkor Roy Tirtho
9f2d423cfe
feat: add invidious audio source and fix auto skipping tracks (#2005)
* feat: add invidious audio source with automatic track switch even on server playback endpoint

* fix: switching to different source on playback endpoint error not working

* chore: update invidious version

* feat: invidious instances customizability
2024-10-17 22:33:03 +06:00
Kingkor Roy Tirtho
cb6b6f142e chore: playback not working in windows due to using loop back ipv4 address 2024-07-01 19:21:12 +06:00
Kingkor Roy Tirtho
6c5cab9899 chore: fix use SpotubeMedia to avoid duplicate sourceTrackProvider instances 2024-06-25 20:36:23 +06:00
Kingkor Roy Tirtho
a83dd64476 refactor: replace all instances of proxy playlist 2024-06-24 20:52:40 +06:00
Kingkor Roy Tirtho
3fb003ea60 refactor(preferences): use Drift sql db for preferences 2024-06-14 00:29:09 +06:00
Kingkor Roy Tirtho
064d92d35d refactor: merge connect and playback server into one server 2024-06-12 20:46:49 +06:00