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

View file

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