diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-01-31 16:32:41 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-01-31 16:32:41 -0800 |
commit | 0a3d8e9b47ab52dbe4b648abb5b7427d7a3f4fd8 (patch) | |
tree | 24ea727ab4fb986b7b2b60a5f3bb514063096544 /src/github | |
parent | 35b43e0b4932cf5a99064592512f98c72b22e2c8 (diff) | |
download | dsub-0a3d8e9b47ab52dbe4b648abb5b7427d7a3f4fd8.tar.gz dsub-0a3d8e9b47ab52dbe4b648abb5b7427d7a3f4fd8.tar.bz2 dsub-0a3d8e9b47ab52dbe4b648abb5b7427d7a3f4fd8.zip |
#271 Fix switching servers not showing synced items
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/util/SyncUtil.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/util/SyncUtil.java b/src/github/daneren2005/dsub/util/SyncUtil.java index 99e6824c..5473ff08 100644 --- a/src/github/daneren2005/dsub/util/SyncUtil.java +++ b/src/github/daneren2005/dsub/util/SyncUtil.java @@ -22,9 +22,21 @@ public final class SyncUtil { private static String TAG = SyncUtil.class.getSimpleName();
private static ArrayList<SyncSet> syncedPlaylists;
private static ArrayList<SyncSet> syncedPodcasts;
+ private static String url;
+
+ private static void checkRestURL(Context context) {
+ Util instance = Util.getActiveServer(context);
+ String newURL = Util.getRestUrl(context, null, instance, false);
+ if(url == null || !url.equals(newURL)) {
+ syncedPlaylists = null;
+ syncedPodcasts = null;
+ url = newURL;
+ }
+ }
// Playlist sync
public static boolean isSyncedPlaylist(Context context, String playlistId) {
+ checkRestURL(context);
if(syncedPlaylists == null) {
syncedPlaylists = getSyncedPlaylists(context);
}
@@ -89,6 +101,7 @@ public final class SyncUtil { // Podcast sync
public static boolean isSyncedPodcast(Context context, String podcastId) {
+ checkRestURL(context);
if(syncedPodcasts == null) {
syncedPodcasts = getSyncedPodcasts(context);
}
|