Fixed artist image updating
This commit is contained in:
parent
d776926510
commit
7aee3c7c72
10 changed files with 64 additions and 217 deletions
|
|
@ -11,6 +11,8 @@ import com.kabouzeid.gramophone.util.MusicUtil;
|
|||
|
||||
import java.io.InputStream;
|
||||
|
||||
import hugo.weaving.DebugLog;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
|
|
@ -30,11 +32,12 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
|||
return model.artistName;
|
||||
}
|
||||
|
||||
@DebugLog
|
||||
@Override
|
||||
public InputStream loadData(Priority priority) throws Exception {
|
||||
if (MusicUtil.isArtistNameUnknown(model.artistName)) return null;
|
||||
|
||||
LastFmArtist lastFmArtist = lastFMRestClient.getApiService().getArtistInfo(model.artistName, model.forceDownload ? "no-cache" : null).execute().body();
|
||||
LastFmArtist lastFmArtist = lastFMRestClient.getApiService().getArtistInfo(model.artistName, model.skipOkHttpCache ? "no-cache" : null).execute().body();
|
||||
|
||||
if (isCancelled) return null;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ package com.kabouzeid.gramophone.glide.artistimage;
|
|||
*/
|
||||
public class ArtistImageRequest {
|
||||
public final String artistName;
|
||||
public final boolean forceDownload;
|
||||
public final boolean skipOkHttpCache;
|
||||
|
||||
public ArtistImageRequest(String artistName, boolean forceDownload) {
|
||||
public ArtistImageRequest(String artistName, boolean skipOkHttpCache) {
|
||||
this.artistName = artistName;
|
||||
this.forceDownload = forceDownload;
|
||||
this.skipOkHttpCache = skipOkHttpCache;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue