diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/CachedMusicService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index 232d0acf..38508e42 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -30,6 +30,7 @@ import org.apache.http.HttpResponse; import android.content.Context; import android.graphics.Bitmap; +import android.util.Log; import github.daneren2005.dsub.domain.Artist; import github.daneren2005.dsub.domain.ArtistInfo; @@ -72,6 +73,7 @@ public class CachedMusicService implements MusicService { private final TimeLimitedCache<List<MusicFolder>> cachedMusicFolders = new TimeLimitedCache<List<MusicFolder>>(10 * 3600, TimeUnit.SECONDS); private final TimeLimitedCache<List<PodcastChannel>> cachedPodcastChannels = new TimeLimitedCache<List<PodcastChannel>>(10 * 3600, TimeUnit.SECONDS); private String restUrl; + private String musicFolderId; private boolean isTagBrowsing = false; public CachedMusicService(RESTMusicService musicService) { @@ -1300,8 +1302,9 @@ public class CachedMusicService implements MusicService { } private void checkSettingsChanged(Context context) { + int instance = musicService.getInstance(context); String newUrl = musicService.getRestUrl(context, null, false); - boolean newIsTagBrowsing = Util.isTagBrowsing(context); + boolean newIsTagBrowsing = Util.isTagBrowsing(context, instance); if (!Util.equals(newUrl, restUrl) || isTagBrowsing != newIsTagBrowsing) { cachedMusicFolders.clear(); cachedLicenseValid.clear(); @@ -1311,5 +1314,11 @@ public class CachedMusicService implements MusicService { restUrl = newUrl; isTagBrowsing = newIsTagBrowsing; } + + String newMusicFolderId = Util.getSelectedMusicFolderId(context, instance); + if(!Util.equals(newMusicFolderId, musicFolderId)) { + cachedIndexes.clear(); + musicFolderId = newMusicFolderId; + } } } |