mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
fix(playback): shuffle button sometimes gets stuck and stops working #183
This commit is contained in:
parent
cdcc0d314d
commit
4240433e3d
@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:audio_service/audio_service.dart';
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
@ -168,6 +167,7 @@ class Playback extends PersistedChangeNotifier {
|
||||
Future<void> playPlaylist(CurrentPlaylist playlist, [int index = 0]) async {
|
||||
try {
|
||||
if (index < 0 || index > playlist.tracks.length - 1) return;
|
||||
if (isPlaying || status == PlaybackStatus.playing) await stop();
|
||||
this.playlist = playlist;
|
||||
final played = this.playlist!.tracks[index];
|
||||
status = PlaybackStatus.loading;
|
||||
|
Loading…
Reference in New Issue
Block a user