diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-09-24 16:08:41 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-09-24 16:08:41 -0700 |
commit | a37c74643b7ac2df3f81e17907de109af72d6939 (patch) | |
tree | d9c629abd8889841ee10a11ec986ff545f7e5e50 /src | |
parent | 5d1e48e94101ceea3ccbb012a40f1eb63b29067b (diff) | |
download | dsub-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.java | 9 |
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; |