Skip to content

Commit

Permalink
fix: stuck on startup
Browse files Browse the repository at this point in the history
due to latest queue casted as Map
  • Loading branch information
MSOB7YY committed Jan 8, 2024
1 parent 8461fb1 commit 0fbb759
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/controller/queue_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ class QueueController {
final latestQueue = <Playable>[];

// -- Reading file.
final res = await File(AppPaths.LATEST_QUEUE).readAsJson() as Map?;
if (res != null) {
try {
try {
final res = await File(AppPaths.LATEST_QUEUE).readAsJson() as Map?;
if (res != null) {
final t = res['type'] as String? ?? LibraryCategory.localTracks;
final items = res['items'] as List;
index = settings.lastPlayedIndices[t] ?? 0;
Expand All @@ -215,8 +215,8 @@ class QueueController {
// case LibraryCategory.localVideos:
// break;
}
} catch (_) {}
}
}
} catch (_) {}

if (latestQueue.isEmpty) return;

Expand Down

0 comments on commit 0fbb759

Please sign in to comment.