Skip to content

Commit

Permalink
fix: error log
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 4, 2023
1 parent 9401718 commit e3d8239
Showing 1 changed file with 19 additions and 25 deletions.
44 changes: 19 additions & 25 deletions lib/provider/proxy_playlist/proxy_playlist_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,35 +216,29 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>
int initialIndex = 0,
bool autoPlay = false,
}) async {
try {
tracks = blacklist.filter(tracks).toList() as List<Track>;
final addableTrack = await SpotubeTrack.fetchFromTrack(
tracks.elementAt(initialIndex),
preferences,
);

print('addableTrack: $addableTrack');
tracks = blacklist.filter(tracks).toList() as List<Track>;
final addableTrack = await SpotubeTrack.fetchFromTrack(
tracks.elementAt(initialIndex),
preferences,
);

state = state.copyWith(
tracks: mergeTracks([addableTrack], tracks),
active: initialIndex,
);
state = state.copyWith(
tracks: mergeTracks([addableTrack], tracks),
active: initialIndex,
);

await notificationService.addTrack(addableTrack);
await notificationService.addTrack(addableTrack);

await audioPlayer.openPlaylist(
state.tracks.map(makeAppropriateSource).toList(),
initialIndex: initialIndex,
autoPlay: autoPlay,
);
await audioPlayer.openPlaylist(
state.tracks.map(makeAppropriateSource).toList(),
initialIndex: initialIndex,
autoPlay: autoPlay,
);

await storeTrack(
tracks.elementAt(initialIndex),
addableTrack,
);
} catch (e) {
print('Error: $e');
}
await storeTrack(
tracks.elementAt(initialIndex),
addableTrack,
);
}

Future<void> jumpTo(int index) async {
Expand Down

0 comments on commit e3d8239

Please sign in to comment.