mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
fix: error log
This commit is contained in:
parent
94017189c6
commit
e3d8239b9f
@ -216,35 +216,29 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>
|
|||||||
int initialIndex = 0,
|
int initialIndex = 0,
|
||||||
bool autoPlay = false,
|
bool autoPlay = false,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
tracks = blacklist.filter(tracks).toList() as List<Track>;
|
||||||
tracks = blacklist.filter(tracks).toList() as List<Track>;
|
final addableTrack = await SpotubeTrack.fetchFromTrack(
|
||||||
final addableTrack = await SpotubeTrack.fetchFromTrack(
|
tracks.elementAt(initialIndex),
|
||||||
tracks.elementAt(initialIndex),
|
preferences,
|
||||||
preferences,
|
);
|
||||||
);
|
|
||||||
|
|
||||||
print('addableTrack: $addableTrack');
|
state = state.copyWith(
|
||||||
|
tracks: mergeTracks([addableTrack], tracks),
|
||||||
|
active: initialIndex,
|
||||||
|
);
|
||||||
|
|
||||||
state = state.copyWith(
|
await notificationService.addTrack(addableTrack);
|
||||||
tracks: mergeTracks([addableTrack], tracks),
|
|
||||||
active: initialIndex,
|
|
||||||
);
|
|
||||||
|
|
||||||
await notificationService.addTrack(addableTrack);
|
await audioPlayer.openPlaylist(
|
||||||
|
state.tracks.map(makeAppropriateSource).toList(),
|
||||||
|
initialIndex: initialIndex,
|
||||||
|
autoPlay: autoPlay,
|
||||||
|
);
|
||||||
|
|
||||||
await audioPlayer.openPlaylist(
|
await storeTrack(
|
||||||
state.tracks.map(makeAppropriateSource).toList(),
|
tracks.elementAt(initialIndex),
|
||||||
initialIndex: initialIndex,
|
addableTrack,
|
||||||
autoPlay: autoPlay,
|
);
|
||||||
);
|
|
||||||
|
|
||||||
await storeTrack(
|
|
||||||
tracks.elementAt(initialIndex),
|
|
||||||
addableTrack,
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
print('Error: $e');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> jumpTo(int index) async {
|
Future<void> jumpTo(int index) async {
|
||||||
|
Loading…
Reference in New Issue
Block a user