diff options
-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 |