diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-01-04 12:58:03 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-01-04 12:58:03 -0800 |
commit | 8a412ca3ace26f543dffa8ae88644b86682dd42c (patch) | |
tree | 7cd1d33c45dcf71925e504ebb68868f7bb528b35 /src | |
parent | 9bc4925ff0a07415b58513044ac4ce1d64caeb6c (diff) | |
download | dsub-8a412ca3ace26f543dffa8ae88644b86682dd42c.tar.gz dsub-8a412ca3ace26f543dffa8ae88644b86682dd42c.tar.bz2 dsub-8a412ca3ace26f543dffa8ae88644b86682dd42c.zip |
Cache artist info
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/CachedMusicService.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index 51f96ffb..f3e91b38 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -893,7 +893,18 @@ public class CachedMusicService implements MusicService { @Override public ArtistInfo getArtistInfo(String id, boolean refresh, Context context, ProgressListener progressListener) throws Exception { - return musicService.getArtistInfo(id, refresh, context, progressListener); + String cacheName = getCacheName(context, "artistInfo", id); + ArtistInfo info = null; + if(!refresh) { + info = FileUtil.deserialize(context, cacheName, ArtistInfo.class); + } + + if(info == null) { + info = musicService.getArtistInfo(id, refresh, context, progressListener); + FileUtil.serialize(context, info, cacheName); + } + + return info; } @Override |