aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-04-15 19:51:22 -0700
committerScott Jackson <daneren2005@gmail.com>2014-04-15 19:51:22 -0700
commit500a1031b9f6b98ab85cb962d4dab706a3938981 (patch)
tree9e4080d4df87eaaf94e11ae1cae50d7a88957dcb /src
parentec8f068abc0d3fa3b14ca173afcacc1f431e36e3 (diff)
downloaddsub-500a1031b9f6b98ab85cb962d4dab706a3938981.tar.gz
dsub-500a1031b9f6b98ab85cb962d4dab706a3938981.tar.bz2
dsub-500a1031b9f6b98ab85cb962d4dab706a3938981.zip
Fix PlaylistAdapter not picking up deleted cache after first pass
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java
index ba4f34c9..5c518d7e 100644
--- a/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java
+++ b/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java
@@ -82,18 +82,16 @@ public class PlaylistSyncAdapter extends SubsonicSyncAdapter {
for(MusicDirectory.Entry entry: playlist.getChildren()) {
DownloadFile file = new DownloadFile(context, entry, true);
String path = file.getCompleteFile().getPath();
- if(!cachedPlaylist.synced.contains(path)) {
- while(!file.isSaved() && !file.isFailedMax()) {
- file.downloadNow(musicService);
- if(!updated.contains(playlist.getName())) {
- updated.add(playlist.getName());
- }
+ while(!file.isSaved() && !file.isFailedMax()) {
+ file.downloadNow(musicService);
+ if(file.isSaved() && !updated.contains(playlist.getName())) {
+ updated.add(playlist.getName());
}
+ }
- // Add to cached path set if saved
- if(file.isSaved()) {
- cachedPlaylist.synced.add(path);
- }
+ // Add to cached path set if saved
+ if(file.isSaved() && !cachedPlaylist.synced.contains(path)) {
+ cachedPlaylist.synced.add(path);
}
origPathList.remove(path);