Skip to content

Commit

Permalink
fix: possible fix for fake error message, closes #86
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Dec 30, 2023
1 parent de3ee38 commit cc61d73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/controller/audio_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -493,19 +493,23 @@ class NamidaAudioVideoHandler<Q extends Playable> extends BasicAudioHandler<Q> {
// -- generating artwork in case it wasnt, to be displayed in notification
Indexer.inst.getArtwork(imagePath: tr.pathToImage, compressed: false).then((value) => refreshNotification());

Future<void> setPls() async {
Future<Duration?> setPls() async {
final dur = await setAudioSource(
tr.toAudioSource(currentIndex, currentQueue.length),
startPlaying: startPlaying,
);
Indexer.inst.updateTrackDuration(tr, dur);

refreshNotification(currentItem);
return dur;
}

Duration? duration;

try {
await setPls();
duration = await setPls();
} catch (e) {
if (duration != null && currentPositionMS > 0) return;
if (item.track == currentTrack.track) {
// -- playing music from root folders still require `all_file_access`
// -- this is a fix for not playing some external files reported by some users.
Expand Down

0 comments on commit cc61d73

Please sign in to comment.