aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-11-07 07:10:27 -0800
committerScott Jackson <daneren2005@gmail.com>2013-11-07 07:10:27 -0800
commit9c45232c7584eadaadbf0f7dc89832c22a465426 (patch)
tree4b89ce2c518f32c8f8f5270f5b128938ec6a832a /src
parentf485e54048ea911039448987552269429e3de9a4 (diff)
downloaddsub-9c45232c7584eadaadbf0f7dc89832c22a465426.tar.gz
dsub-9c45232c7584eadaadbf0f7dc89832c22a465426.tar.bz2
dsub-9c45232c7584eadaadbf0f7dc89832c22a465426.zip
Move > size handling to DownloadService so it can cover all cases
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/DownloadFragment.java8
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceImpl.java9
2 files changed, 9 insertions, 8 deletions
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 5af030d3..50960834 100644
--- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -231,12 +231,8 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
new SilentBackgroundTask<Boolean>(context) {
@Override
protected Boolean doInBackground() throws Throwable {
- if (getDownloadService().getCurrentPlayingIndex() < getDownloadService().size() - 1) {
- getDownloadService().next();
- return true;
- } else {
- return false;
- }
+ getDownloadService().next();
+ return true;
}
@Override
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 731794de..d88b5262 100644
--- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -770,8 +770,13 @@ public class DownloadServiceImpl extends Service implements DownloadService {
@Override
public synchronized void next() {
int index = getCurrentPlayingIndex();
- if (index != -1) {
- play(getNextPlayingIndex());
+ int nextPlayingIndex = getNextPlayingIndex();
+ // Make sure to actually go to next when repeat song is on
+ if(index == nextPlayingIndex) {
+ nextPlayingIndex++;
+ }
+ if (index != -1 && nextPlayingIndex < size()) {
+ play(nextPlayingIndex);
}
}