diff options
Diffstat (limited to 'src/github/daneren2005/dsub/service/CachedMusicService.java')
-rw-r--r-- | src/github/daneren2005/dsub/service/CachedMusicService.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index 8e8e120d..232d0acf 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -32,6 +32,7 @@ import android.content.Context; import android.graphics.Bitmap; import github.daneren2005.dsub.domain.Artist; +import github.daneren2005.dsub.domain.ArtistInfo; import github.daneren2005.dsub.domain.Bookmark; import github.daneren2005.dsub.domain.ChatMessage; import github.daneren2005.dsub.domain.Genre; @@ -891,6 +892,27 @@ public class CachedMusicService implements MusicService { } @Override + public ArtistInfo getArtistInfo(String id, boolean refresh, Context context, ProgressListener progressListener) throws Exception { + 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 + public Bitmap getBitmap(String url, int size, Context context, ProgressListener progressListener, SilentBackgroundTask task) throws Exception { + return musicService.getBitmap(url, size, context, progressListener, task); + } + + @Override public int processOfflineSyncs(final Context context, final ProgressListener progressListener) throws Exception{ return musicService.processOfflineSyncs(context, progressListener); } |