aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;