diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-04-15 19:51:22 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-04-15 19:51:22 -0700 |
commit | 500a1031b9f6b98ab85cb962d4dab706a3938981 (patch) | |
tree | 9e4080d4df87eaaf94e11ae1cae50d7a88957dcb | |
parent | ec8f068abc0d3fa3b14ca173afcacc1f431e36e3 (diff) | |
download | dsub-500a1031b9f6b98ab85cb962d4dab706a3938981.tar.gz dsub-500a1031b9f6b98ab85cb962d4dab706a3938981.tar.bz2 dsub-500a1031b9f6b98ab85cb962d4dab706a3938981.zip |
Fix PlaylistAdapter not picking up deleted cache after first pass
-rw-r--r-- | src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java | 18 |
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);
|