diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-12-12 22:12:47 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-12-12 22:12:47 -0800 |
commit | 6ad4c29a79c3c405fb6a6f28ee3fba5bf7431c8c (patch) | |
tree | 29d59753ebfd9d15e941969678102bd44130307f | |
parent | cfa420769addee0efa1b5b62b150ccfdd2e91ffe (diff) | |
download | dsub-6ad4c29a79c3c405fb6a6f28ee3fba5bf7431c8c.tar.gz dsub-6ad4c29a79c3c405fb6a6f28ee3fba5bf7431c8c.tar.bz2 dsub-6ad4c29a79c3c405fb6a6f28ee3fba5bf7431c8c.zip |
Refresh listings in various sync adapters to give illusion of dynamic content
3 files changed, 16 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java index 82120b56..7bead10b 100644 --- a/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java +++ b/src/github/daneren2005/dsub/service/sync/MostRecentSyncAdapter.java @@ -78,6 +78,11 @@ public class MostRecentSyncAdapter extends SubsonicSyncAdapter { if(updated) {
FileUtil.serialize(context, syncedList, SyncUtil.getMostRecentSyncFile(context, instance));
+
+ // If there is a new album on the active server, chances are artists need to be refreshed
+ if(Util.getActiveServer(context) == instance) {
+ musicService.getIndexes(Util.getSelectedMusicFolderId(context), true, context, null);
+ }
}
} catch(Exception e) {
Log.e(TAG, "Failed to get most recent list for " + Util.getServerName(context, instance));
diff --git a/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java index 6e3b49c3..6724e561 100644 --- a/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java +++ b/src/github/daneren2005/dsub/service/sync/PlaylistSyncAdapter.java @@ -49,6 +49,14 @@ public class PlaylistSyncAdapter extends SubsonicSyncAdapter { @Override
public void onExecuteSync(Context context, int instance) {
String serverName = Util.getServerName(context, instance);
+
+ try {
+ // Just update playlist listings so user doesn't have to
+ musicService.getPlaylists(true, context, null);
+ } catch(Exception e) {
+ Log.e(TAG, "Failed to refresh playlist list for " + serverName);
+ }
+
List<String> playlistList = SyncUtil.getSyncedPlaylists(context, instance);
for(int i = 0; i < playlistList.size(); i++) {
String id = playlistList.get(i);
diff --git a/src/github/daneren2005/dsub/service/sync/PodcastSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/PodcastSyncAdapter.java index b5d39d72..4826c214 100644 --- a/src/github/daneren2005/dsub/service/sync/PodcastSyncAdapter.java +++ b/src/github/daneren2005/dsub/service/sync/PodcastSyncAdapter.java @@ -61,6 +61,9 @@ public class PodcastSyncAdapter extends SubsonicSyncAdapter { if(podcastList.size() > 0) {
// Refresh podcast listings before syncing
musicService.refreshPodcasts(context, null);
+
+ // Just update podcast listings so user doesn't have to
+ musicService.getPodcastChannels(true, context, null);
}
boolean updated = false;
|