From b0e78505555701084b18496e5561f92328b1c66f Mon Sep 17 00:00:00 2001 From: Daniel Bowman Date: Sat, 24 Nov 2018 19:03:50 +0000 Subject: Stop current track if rated bad and empty playlist --- .../main/java/github/daneren2005/dsub/service/DownloadService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index 0fb5e9e5..e9096900 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -2806,14 +2806,16 @@ public class DownloadService extends Service { } public void setRating(int rating) { final DownloadFile currentPlaying = this.currentPlaying; - if(currentPlaying == null) { + if (currentPlaying == null) { return; } MusicDirectory.Entry entry = currentPlaying.getSong(); // Immediately skip to the next song if down thumbed - if(rating == 1) { + if (rating == 1 && size() > 1) { next(true); + } else if (rating == 1 && size() == 1) { + stop(); } UpdateHelper.setRating(this, entry, rating, new UpdateHelper.OnRatingChange() { -- cgit v1.2.3