aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-03 12:56:20 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-03 12:56:20 -0700
commit64fd777646d40a6c96cabbb90c3051593cacc6ae (patch)
treefe74f8aebe6c1397051d45cf3acfad69ba23b8a1
parent68a35817c58f22457df3de4f2be81f53b1a2adba (diff)
downloaddsub-64fd777646d40a6c96cabbb90c3051593cacc6ae.tar.gz
dsub-64fd777646d40a6c96cabbb90c3051593cacc6ae.tar.bz2
dsub-64fd777646d40a6c96cabbb90c3051593cacc6ae.zip
#113 Skip to next song when down rating it
-rw-r--r--src/github/daneren2005/dsub/fragments/NowPlayingFragment.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
index 5dc550f7..6543dcb5 100644
--- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
+++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
@@ -374,7 +374,12 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
rateBadButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- Entry entry = getDownloadService().getCurrentPlaying().getSong();
+ DownloadService downloadService = getDownloadService();
+ if(downloadService == null) {
+ return;
+ }
+
+ Entry entry = downloadService.getCurrentPlaying().getSong();
// If rating == 1, already set so unset
if(entry.getRating() == 1) {
@@ -386,6 +391,9 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
rateBadButton.setImageResource(Util.getAttribute(context, R.attr.rating_bad));
}
} else {
+ // Immediately skip to the next song
+ downloadService.next();
+
// Otherwise set rating to 1
setRating(entry, 1);
rateBadButton.setImageResource(R.drawable.ic_action_rating_bad_selected);