aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-05-19 22:38:48 -0700
committerScott Jackson <daneren2005@gmail.com>2014-05-19 22:38:48 -0700
commit7b1da2e065fc324f4b490fa6e98daf6e591a33d9 (patch)
tree5042adfe5c2d0a4c3bb011861d3033060ad5a73f
parent7a0175cea478d2fb31fedee263500f67701171bf (diff)
downloaddsub-7b1da2e065fc324f4b490fa6e98daf6e591a33d9.tar.gz
dsub-7b1da2e065fc324f4b490fa6e98daf6e591a33d9.tar.bz2
dsub-7b1da2e065fc324f4b490fa6e98daf6e591a33d9.zip
Fix most recent sync with tags, make sure to use tag check on first result as well
-rw-r--r--src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java2
-rw-r--r--src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java32
2 files changed, 17 insertions, 17 deletions
diff --git a/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java
index 09194d25..0801bf7c 100644
--- a/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java
+++ b/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java
@@ -69,7 +69,7 @@ public class MostRecentSyncAdapter extends SubsonicSyncAdapter {
if(!syncedList.contains(album.getId())) {
if(!"Podcast".equals(album.getGenre())) {
try {
- if(downloadRecursively(null, musicService.getMusicDirectory(album.getId(), album.getTitle(), true, context, null), context, false)) {
+ if(downloadRecursively(null, getMusicDirectory(album), context, false)) {
updated.add(album.getTitle());
}
} catch(Exception e) {
diff --git a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
index 905277e9..d0b3b706 100644
--- a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
+++ b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
@@ -123,7 +123,7 @@ public class SubsonicSyncAdapter extends AbstractThreadedSyncAdapter {
public void onExecuteSync(Context context, int instance) {
}
-
+
protected boolean downloadRecursively(List<String> paths, MusicDirectory parent, Context context, boolean save) throws Exception {
boolean downloaded = false;
for (MusicDirectory.Entry song: parent.getChildren(false, true)) {
@@ -141,27 +141,27 @@ public class SubsonicSyncAdapter extends AbstractThreadedSyncAdapter {
}
for (MusicDirectory.Entry dir: parent.getChildren(true, false)) {
- String id = dir.getId();
- String name = dir.getTitle();
-
- MusicDirectory contents;
- if(tagBrowsing) {
- if(dir.getParent() == null || dir.getArtist() == null) {
- contents = musicService.getArtist(id, name, true, context, null);
- } else {
- contents = musicService.getAlbum(id, name, true, context, null);
- }
- } else {
- contents = musicService.getMusicDirectory(id, name, true, context, null);
- }
-
- if(downloadRecursively(paths, contents, context, save)) {
+ if(downloadRecursively(paths, getMusicDirectory(dir), context, save)) {
downloaded = true;
}
}
return downloaded;
}
+ protected MusicDirectory getMusicDirectory(MusicDirectory.Entry dir) throws Exception{
+ String id = dir.getId();
+ String name = dir.getTitle();
+
+ if(tagBrowsing) {
+ if(dir.getArtist() == null) {
+ return musicService.getArtist(id, name, true, context, null);
+ } else {
+ return musicService.getAlbum(id, name, true, context, null);
+ }
+ } else {
+ return musicService.getMusicDirectory(id, name, true, context, null);
+ }
+ }
private boolean isValidServer(Context context, int instance) {
String url = Util.getRestUrl(context, "null", instance, false);