From 7389b1fa486e173ed73a0c3071dfa198460c5e46 Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Fri, 5 Apr 2013 15:03:32 -0700 Subject: Make sure to have only one next playing task going at a time --- .../src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'subsonic-android') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 17b22e3e..f94d045d 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -537,16 +537,16 @@ public class DownloadServiceImpl extends Service implements DownloadService { } nextSetup = false; + if(nextPlayingTask != null) { + nextPlayingTask.cancel(); + nextPlayingTask = null; + } if(index < size() && index != -1) { nextPlaying = downloadList.get(index); nextPlayingTask = new CheckCompletionTask(nextPlaying); nextPlayingTask.start(); } else { nextPlaying = null; - if(nextPlayingTask != null) { - nextPlayingTask.cancel(); - } - nextPlayingTask = null; setNextPlayerState(IDLE); } } -- cgit v1.2.3