Commit Graph

40 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
70970f62f1 chore: fix connect play playlist/album and clear queue not working 2025-09-11 21:52:43 +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
5f47dc3d6d refactor: remove old spotify.dart types and custom spotube metadata types 2025-06-19 14:42:29 +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
a06614bc5c feat: add connect confirmation dialog 2025-04-27 22:39:16 +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
e3285bd4da fix: selecting an Alternative Track Source removes the current song from the queue #2039 2024-11-10 11:27:56 +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
86ee64c606 chore: remove old logger 2024-07-06 22:02:31 +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
08ac29c979 refactor(stats): migrate stats to use drift db 2024-06-29 17:05:06 +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
1b420e661b chore: player skipping all tracks from cache 2024-06-24 22:26:44 +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
Kingkor Roy Tirtho
f9087b63d5 refactor: remove catcher_2 and use custom zoned based error handling 2024-06-09 22:52:34 +06:00
Kingkor Roy Tirtho
57ccf16311 refactor: rename providers 2024-04-12 11:06:03 +06:00
Kingkor Roy Tirtho
22a49e56a2
refactor: use tcp server based track matcher (#1386)
* refactor: remove SourcedTrack based audio player and utilize mediakit playback system

* feat: implement local (loopback) server to resolve stream source and leverage the media_kit playback API

* feat: add source change support and re-add prefetching tracks

* fix: assign lastId when track fetch completes regardless of error

* chore: remove print statements

* fix: remote queue not working

* fix: increase mpv network timeout to reduce auto-skipping

* fix: do not pre-fetch local tracks

* fix(proxy-playlist): reset collections on load

* chore: fix lint warnings

* fix(mobile): player overlay should not be visible when the player is not playing

* chore: fix typo in turkish translation

* cd: checkout PR branch

* cd: upgrade flutter version

* chore: fix lint errors
2024-04-11 17:56:41 +06:00