aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-01-13 07:34:28 -0800
committerScott Jackson <daneren2005@gmail.com>2014-01-13 07:34:28 -0800
commitfdda03ceed2b46a4a008dac48e88c4bc5e654aa3 (patch)
tree2b32728817ce347b6549d5f4d689bd0eddbe4987 /src
parent4333c8992f7b440d5e4013f017e3b4134a53ae71 (diff)
downloaddsub-fdda03ceed2b46a4a008dac48e88c4bc5e654aa3.tar.gz
dsub-fdda03ceed2b46a4a008dac48e88c4bc5e654aa3.tar.bz2
dsub-fdda03ceed2b46a4a008dac48e88c4bc5e654aa3.zip
#46 Fix index cache with id3 tags
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/CachedMusicService.java5
-rw-r--r--src/github/daneren2005/dsub/service/RESTMusicService.java2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java
index f223c5a6..a7a61f71 100644
--- a/src/github/daneren2005/dsub/service/CachedMusicService.java
+++ b/src/github/daneren2005/dsub/service/CachedMusicService.java
@@ -66,6 +66,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 boolean isTagBrowsing = false;
public CachedMusicService(RESTMusicService musicService) {
this.musicService = musicService;
@@ -503,13 +504,15 @@ public class CachedMusicService implements MusicService {
private void checkSettingsChanged(Context context) {
String newUrl = musicService.getRestUrl(context, null, false);
- if (!Util.equals(newUrl, restUrl)) {
+ boolean newIsTagBrowsing = Util.isTagBrowsing(context);
+ if (!Util.equals(newUrl, restUrl) || isTagBrowsing != newIsTagBrowsing) {
cachedMusicFolders.clear();
cachedLicenseValid.clear();
cachedIndexes.clear();
cachedPlaylists.clear();
cachedPodcastChannels.clear();
restUrl = newUrl;
+ isTagBrowsing = newIsTagBrowsing;
}
}
}
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java
index 906d2ad4..f9fcc604 100644
--- a/src/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/src/github/daneren2005/dsub/service/RESTMusicService.java
@@ -248,7 +248,7 @@ public class RESTMusicService implements MusicService {
private String getCachedIndexesFilename(Context context, String musicFolderId) {
String s = getRestUrl(context, null) + musicFolderId;
- return "indexes-" + Math.abs(s.hashCode()) + ".ser";
+ return (Util.isTagBrowsing(context, getInstance(context)) ? "artists-" : "indexes-") + Math.abs(s.hashCode()) + ".ser";
}
@Override