diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-09-03 12:56:20 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-09-03 12:56:20 -0700 |
commit | 64fd777646d40a6c96cabbb90c3051593cacc6ae (patch) | |
tree | fe74f8aebe6c1397051d45cf3acfad69ba23b8a1 | |
parent | 68a35817c58f22457df3de4f2be81f53b1a2adba (diff) | |
download | dsub-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.java | 10 |
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);
|