diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 12 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/JukeboxController.java | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 06c7495d..88898887 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -252,6 +252,10 @@ public class DownloadServiceImpl extends Service implements DownloadService { if(nextPlayingTask != null) { nextPlayingTask.cancel(); } + if(remoteController != null) { + remoteController.stop(); + remoteController.shutdown(); + } Util.hidePlayingNotification(this, this, handler); } @@ -348,7 +352,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { } play(currentPlayingIndex, false); - if (currentPlaying != null && currentPlaying.isCompleteFileAvailable()) { + if (currentPlaying != null && currentPlaying.isCompleteFileAvailable() && remoteState == RemoteControlState.LOCAL) { doPlay(currentPlaying, currentPlayingPosition, autoPlayStart); } autoPlayStart = false; @@ -673,8 +677,10 @@ public class DownloadServiceImpl extends Service implements DownloadService { bufferAndPlay(); } } - checkDownloads(); - setNextPlaying(); + if (remoteState == RemoteControlState.LOCAL) { + checkDownloads(); + setNextPlaying(); + } } } private synchronized void playNext() { diff --git a/src/github/daneren2005/dsub/service/JukeboxController.java b/src/github/daneren2005/dsub/service/JukeboxController.java index 30160c1c..3904066d 100644 --- a/src/github/daneren2005/dsub/service/JukeboxController.java +++ b/src/github/daneren2005/dsub/service/JukeboxController.java @@ -149,7 +149,7 @@ public class JukeboxController extends RemoteController { try { task = tasks.take(); RemoteStatus status = task.execute(); - if(status != null) { + if(status != null && running) { onStatusUpdate(status); } } catch (Throwable x) { |