mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-12 02:37:18 +02:00
fix: trigger smart queue for local play actions
This commit is contained in:
1 parent
e6ffb08954
commit
bddd733466
1 file changed
+11
@@ -1282,6 +1282,7 @@ class PlaybackController extends Notifier<PlaybackState> {
|
|||||||
required String artist,
|
required String artist,
|
||||||
String album = '',
|
String album = '',
|
||||||
String coverUrl = '',
|
String coverUrl = '',
|
||||||
|
Track? track,
|
||||||
}) async {
|
}) async {
|
||||||
final requestEpoch = _startNewPlayRequest();
|
final requestEpoch = _startNewPlayRequest();
|
||||||
_resetPrefetchCycleState();
|
_resetPrefetchCycleState();
|
||||||
@@ -1289,6 +1290,15 @@ class PlaybackController extends Notifier<PlaybackState> {
|
|||||||
_pendingResumePosition = null;
|
_pendingResumePosition = null;
|
||||||
_pendingResumeIndex = null;
|
_pendingResumeIndex = null;
|
||||||
final uri = _uriFromPath(path);
|
final uri = _uriFromPath(path);
|
||||||
|
final fallbackTrack = Track(
|
||||||
|
id: path,
|
||||||
|
name: title,
|
||||||
|
artistName: artist,
|
||||||
|
albumName: album,
|
||||||
|
coverUrl: coverUrl.isNotEmpty ? coverUrl : null,
|
||||||
|
duration: 0,
|
||||||
|
source: 'local',
|
||||||
|
);
|
||||||
final item = PlaybackItem(
|
final item = PlaybackItem(
|
||||||
id: path,
|
id: path,
|
||||||
title: title,
|
title: title,
|
||||||
@@ -1298,6 +1308,7 @@ class PlaybackController extends Notifier<PlaybackState> {
|
|||||||
sourceUri: uri.toString(),
|
sourceUri: uri.toString(),
|
||||||
isLocal: true,
|
isLocal: true,
|
||||||
service: 'offline',
|
service: 'offline',
|
||||||
|
track: track ?? fallbackTrack,
|
||||||
);
|
);
|
||||||
|
|
||||||
_clearLyricsForTrackChange(upcomingItem: item);
|
_clearLyricsForTrackChange(upcomingItem: item);
|
||||||
|
|||||||
Reference in new issue
Block a user