Added "lang" parameter to show localized biography.
This commit is contained in:
parent
4d8c9360c9
commit
e0467e4fff
3 changed files with 5 additions and 3 deletions
|
|
@ -49,7 +49,7 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
|||
@Override
|
||||
public InputStream loadData(Priority priority) throws Exception {
|
||||
if (!MusicUtil.isArtistNameUnknown(model.artistName) && Util.isAllowedToAutoDownload(context)) {
|
||||
Response<LastFmArtist> response = lastFMRestClient.getApiService().getArtistInfo(model.artistName, model.skipOkHttpCache ? "no-cache" : null).execute();
|
||||
Response<LastFmArtist> response = lastFMRestClient.getApiService().getArtistInfo(model.artistName, null, model.skipOkHttpCache ? "no-cache" : null).execute();
|
||||
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException("Request failed with code: " + response.code());
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ public interface LastFMService {
|
|||
Call<LastFmAlbum> getAlbumInfo(@Query("album") String albumName, @Query("artist") String artistName);
|
||||
|
||||
@GET(BASE_QUERY_PARAMETERS + "&method=artist.getinfo")
|
||||
Call<LastFmArtist> getArtistInfo(@Query("artist") String artistName, @Nullable @Header("Cache-Control") String cacheControl);
|
||||
Call<LastFmArtist> getArtistInfo(@Query("artist") String artistName, @Nullable @Query("lang") String language, @Nullable @Header("Cache-Control") String cacheControl);
|
||||
}
|
||||
|
|
@ -57,6 +57,8 @@ import com.kabouzeid.gramophone.util.PreferenceUtil;
|
|||
import com.kabouzeid.gramophone.util.Util;
|
||||
import com.kabouzeid.gramophone.util.ViewUtil;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import retrofit2.Call;
|
||||
|
|
@ -223,7 +225,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
}
|
||||
|
||||
private void loadBiography() {
|
||||
lastFMRestClient.getApiService().getArtistInfo(getArtist().getName(), null).enqueue(new Callback<LastFmArtist>() {
|
||||
lastFMRestClient.getApiService().getArtistInfo(getArtist().getName(), Locale.getDefault().getLanguage(), null).enqueue(new Callback<LastFmArtist>() {
|
||||
@Override
|
||||
public void onResponse(Call<LastFmArtist> call, Response<LastFmArtist> response) {
|
||||
LastFmArtist lastFmArtist = response.body();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue