aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-07-24 13:23:23 -0700
committerScott Jackson <daneren2005@gmail.com>2014-07-24 13:23:23 -0700
commitb5cb29304cdbe2ae3ce2c903ea5ff8a408399cd9 (patch)
tree20b3f25fbb2af5eed69d0078704c63a41ca59e53
parent07d295fa9916902e4c0b83847be8068028640632 (diff)
downloaddsub-b5cb29304cdbe2ae3ce2c903ea5ff8a408399cd9.tar.gz
dsub-b5cb29304cdbe2ae3ce2c903ea5ff8a408399cd9.tar.bz2
dsub-b5cb29304cdbe2ae3ce2c903ea5ff8a408399cd9.zip
Move indexes cache to CachedMusicService
-rw-r--r--src/github/daneren2005/dsub/service/CachedMusicService.java11
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 4f722d5c..611e438e 100644
--- a/src/github/daneren2005/dsub/service/CachedMusicService.java
+++ b/src/github/daneren2005/dsub/service/CachedMusicService.java
@@ -131,7 +131,16 @@ public class CachedMusicService implements MusicService {
}
Indexes result = cachedIndexes.get();
if (result == null) {
- result = musicService.getIndexes(musicFolderId, refresh, context, progressListener);
+ String name = Util.isTagBrowsing(context, musicService.getInstance(context)) ? "artists" : "indexes";
+ name = getCacheName(context, name, musicFolderId);
+ if(!refresh) {
+ result = FileUtil.deserialize(context, name, Indexes.class);
+ }
+
+ if(result == null) {
+ result = musicService.getIndexes(musicFolderId, refresh, context, progressListener);
+ FileUtil.serialize(context, result, name);
+ }
cachedIndexes.set(result);
}
return result;