aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@users.noreply.github.com>2018-11-26 22:34:19 -0800
committerGitHub <noreply@github.com>2018-11-26 22:34:19 -0800
commit95340f216ec1276c2ace44da9b7622f02e967b05 (patch)
treeeead9c02c3edf6a00c2772147cac2ecd9abdeb31 /app
parent0021824a74ce86ee951c91045504a99e84df46c4 (diff)
parentb0e78505555701084b18496e5561f92328b1c66f (diff)
downloaddsub-95340f216ec1276c2ace44da9b7622f02e967b05.tar.gz
dsub-95340f216ec1276c2ace44da9b7622f02e967b05.tar.bz2
dsub-95340f216ec1276c2ace44da9b7622f02e967b05.zip
Merge pull request #920 from vrih/fix/stop-on-downvote
Stop current track if rated bad and empty playlist
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DownloadService.java6
1 files 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() {