Fix for default language

This commit is contained in:
Eugene Cheung 2017-07-05 12:43:00 -04:00
commit 93afb33e0d
No known key found for this signature in database
GPG key ID: E1FD745328866B0A
2 changed files with 15 additions and 11 deletions

View file

@ -273,12 +273,14 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
final String wikiContent = lastFmAlbum.getAlbum().getWiki().getContent(); final String wikiContent = lastFmAlbum.getAlbum().getWiki().getContent();
if (wikiContent != null && !wikiContent.trim().isEmpty()) { if (wikiContent != null && !wikiContent.trim().isEmpty()) {
wiki = Html.fromHtml(wikiContent); wiki = Html.fromHtml(wikiContent);
} else if (lang != null) { }
}
// If the "lang" parameter is set and no wiki is given, retry with default language // If the "lang" parameter is set and no wiki is given, retry with default language
if (wiki == null && lang != null) {
loadWiki(null); loadWiki(null);
return; return;
} }
}
if (!Util.isAllowedToDownloadMetadata(AlbumDetailActivity.this)) { if (!Util.isAllowedToDownloadMetadata(AlbumDetailActivity.this)) {
if (wiki != null) { if (wiki != null) {

View file

@ -239,15 +239,17 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
public void onResponse(@NonNull Call<LastFmArtist> call, @NonNull Response<LastFmArtist> response) { public void onResponse(@NonNull Call<LastFmArtist> call, @NonNull Response<LastFmArtist> response) {
final LastFmArtist lastFmArtist = response.body(); final LastFmArtist lastFmArtist = response.body();
if (lastFmArtist != null && lastFmArtist.getArtist() != null) { if (lastFmArtist != null && lastFmArtist.getArtist() != null) {
String bio = lastFmArtist.getArtist().getBio().getContent(); final String bioContent = lastFmArtist.getArtist().getBio().getContent();
if (bio != null && !bio.trim().isEmpty()) { if (bioContent != null && !bioContent.trim().isEmpty()) {
biography = Html.fromHtml(bio); biography = Html.fromHtml(bioContent);
} else if (lang != null) { }
}
// If the "lang" parameter is set and no biography is given, retry with default language // If the "lang" parameter is set and no biography is given, retry with default language
if (biography == null && lang != null) {
loadBiography(null); loadBiography(null);
return; return;
} }
}
if (!Util.isAllowedToDownloadMetadata(ArtistDetailActivity.this)) { if (!Util.isAllowedToDownloadMetadata(ArtistDetailActivity.this)) {
if (biography != null) { if (biography != null) {