aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-09-24 16:08:41 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-09-24 16:08:41 -0700
commita37c74643b7ac2df3f81e17907de109af72d6939 (patch)
treed9c629abd8889841ee10a11ec986ff545f7e5e50 /src
parent5d1e48e94101ceea3ccbb012a40f1eb63b29067b (diff)
downloaddsub-a37c74643b7ac2df3f81e17907de109af72d6939.tar.gz
dsub-a37c74643b7ac2df3f81e17907de109af72d6939.tar.bz2
dsub-a37c74643b7ac2df3f81e17907de109af72d6939.zip
Add MusicFolder serialization back into CachedMusicService
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/CachedMusicService.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java
index 8c888d81..f48ad337 100644
--- a/src/github/daneren2005/dsub/service/CachedMusicService.java
+++ b/src/github/daneren2005/dsub/service/CachedMusicService.java
@@ -93,7 +93,14 @@ public class CachedMusicService implements MusicService {
}
List<MusicFolder> result = cachedMusicFolders.get();
if (result == null) {
- result = musicService.getMusicFolders(refresh, context, progressListener);
+ if(!refresh) {
+ result = FileUtil.deserialize(context, getCacheName(context, "musicFolders"), List.class);
+ }
+
+ if(result == null) {
+ result = musicService.getMusicFolders(refresh, context, progressListener);
+ FileUtil.serialize(context, result, getCacheName(context, "musicFolders"));
+ }
cachedMusicFolders.set(result);
}
return result;