diff --git a/app/src/main/java/com/dkanada/gramophone/helper/EventListener.java b/app/src/main/java/com/dkanada/gramophone/helper/EventListener.java index 727ef084..fbf17f2d 100644 --- a/app/src/main/java/com/dkanada/gramophone/helper/EventListener.java +++ b/app/src/main/java/com/dkanada/gramophone/helper/EventListener.java @@ -80,7 +80,6 @@ public class EventListener extends ApiEventListener { MusicPlayerRemote.seekTo((int) position); break; case Stop: - MusicPlayerRemote.pauseSong(); MusicPlayerRemote.clearQueue(); } } diff --git a/app/src/main/java/com/dkanada/gramophone/service/MusicService.java b/app/src/main/java/com/dkanada/gramophone/service/MusicService.java index 682d4c4f..3e2c455e 100644 --- a/app/src/main/java/com/dkanada/gramophone/service/MusicService.java +++ b/app/src/main/java/com/dkanada/gramophone/service/MusicService.java @@ -513,8 +513,8 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP private void openCurrent() { synchronized (this) { - // current song will be null when queue is cleared - if (getCurrentSong() == null) return; + // current song title will be null when queue is cleared + if (getCurrentSong().title == null) return; playback.setDataSource(getCurrentSong()); } @@ -547,7 +547,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP } public void updateNotification() { - if (playingNotification != null && getCurrentSong().id != null) { + if (playingNotification != null && getCurrentSong().title != null) { playingNotification.update(); } } @@ -564,7 +564,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP private void updateMediaSessionMetadata() { final Song song = getCurrentSong(); - if (song.id == null) { + if (song.title == null) { mediaSession.setMetadata(null); return; } @@ -1002,6 +1002,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP if (playingQueue.size() > 0) { prepareNext(); } else { + playback.pause(); playingNotification.stop(); } break;