aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-04-14 15:35:23 -0700
committerScott Jackson <daneren2005@gmail.com>2013-04-14 15:35:23 -0700
commit97d0ceeb0c5050287396796c1df68fc6abfc7fb7 (patch)
tree48f8e0f73b6fc2e915765ec03e608868c7d89d00 /subsonic-android/src
parent9332ef810316e3ff926a51e5a050fbc97ccfc9a8 (diff)
downloaddsub-97d0ceeb0c5050287396796c1df68fc6abfc7fb7.tar.gz
dsub-97d0ceeb0c5050287396796c1df68fc6abfc7fb7.tar.bz2
dsub-97d0ceeb0c5050287396796c1df68fc6abfc7fb7.zip
Make sure to do swapping from the correct list
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java2
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java2
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java13
3 files changed, 9 insertions, 8 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
index 3d4ef34b..3de6178f 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
@@ -427,7 +427,7 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
playlistView.setDropListener(new DragSortListView.DropListener() {
@Override
public void drop(int from, int to) {
- getDownloadService().swap(from, to);
+ getDownloadService().swap(nowPlaying, from, to);
onDownloadListChanged();
}
});
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
index 6286f906..43e24096 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
@@ -135,5 +135,5 @@ public interface DownloadService {
void setVolume(float volume);
- void swap(int from, int to);
+ void swap(boolean mainList, int from, int to);
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index e511d089..8136114f 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -1216,8 +1216,9 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
@Override
- public synchronized void swap(int from, int to) {
- int max = size();
+ public synchronized void swap(boolean mainList, int from, int to) {
+ List<DownloadFile> list = mainList ? downloadList : backgroundDownloadList;
+ int max = list.size();
if(to >= max) {
to = max - 1;
}
@@ -1226,11 +1227,11 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
int currentPlayingIndex = getCurrentPlayingIndex();
- DownloadFile movedSong = downloadList.remove(from);
- downloadList.add(to, movedSong);
- if(jukeboxEnabled) {
+ DownloadFile movedSong = list.remove(from);
+ list.add(to, movedSong);
+ if(jukeboxEnabled && mainList) {
updateJukeboxPlaylist();
- } else if(movedSong == nextPlaying || (currentPlayingIndex + 1) == to) {
+ } else if(mainList && (movedSong == nextPlaying || (currentPlayingIndex + 1) == to)) {
// Moving next playing or moving a song to be next playing
setNextPlaying();
}