From 4bf8715486ccd51640dd661f3f6e35f66eed2c41 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 30 Aug 2024 22:16:10 +0800 Subject: [PATCH] :bug: Fix timeout --- lib/providers/audio_player.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/providers/audio_player.dart b/lib/providers/audio_player.dart index b562463..a8cf58f 100644 --- a/lib/providers/audio_player.dart +++ b/lib/providers/audio_player.dart @@ -7,6 +7,9 @@ import 'package:media_kit/media_kit.dart' hide Track; import 'package:rhythm_box/providers/database.dart'; import 'package:rhythm_box/services/audio_player/state.dart'; import 'package:rhythm_box/services/database/database.dart'; +import 'package:rhythm_box/services/local_track.dart'; +import 'package:rhythm_box/services/server/sourced_track.dart'; +import 'package:rhythm_box/widgets/tracks/querying_track_info.dart'; import 'package:spotify/spotify.dart' hide Playlist; import 'package:rhythm_box/services/audio_player/audio_player.dart'; @@ -248,11 +251,12 @@ class AudioPlayerProvider extends GetxController { // Giving the initial track a boost so MediaKit won't skip // because of timeout - // final intendedActiveTrack = medias.elementAt(initialIndex); - // if (intendedActiveTrack.track is! LocalTrack) { - // await Get.find() - // .fetch(RhythmMedia(intendedActiveTrack.track)); - // } + Get.find().isQueryingTrackInfo.value = true; + final intendedActiveTrack = medias.elementAt(initialIndex); + if (intendedActiveTrack.track is! LocalTrack) { + await Get.find() + .fetch(RhythmMedia(intendedActiveTrack.track)); + } if (medias.isEmpty) return;