Skip to content

Commit

Permalink
Fix AudioNowPlayingFragment showing "From null" when there is no albu…
Browse files Browse the repository at this point in the history
…m name
  • Loading branch information
nielsvanvelzen committed Jul 14, 2024
1 parent 9e41a8b commit 4a2115f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,12 @@ private void updateInfo(org.jellyfin.sdk.model.api.BaseItemDto item) {
if (item != null) {
mArtistName.setText(getArtistName(item));
mSongTitle.setText(item.getName());
mAlbumTitle.setText(getResources().getString(R.string.lbl_now_playing_album, item.getAlbum()));
mCurrentNdx.setText(getResources().getString(R.string.lbl_now_playing_track, mediaManager.getValue().getCurrentAudioQueueDisplayPosition(), mediaManager.getValue().getCurrentAudioQueueDisplaySize()));
if (item.getAlbum() != null) {
mAlbumTitle.setText(getString(R.string.lbl_now_playing_album, item.getAlbum()));
} else {
mAlbumTitle.setText(null);
}
mCurrentNdx.setText(getString(R.string.lbl_now_playing_track, mediaManager.getValue().getCurrentAudioQueueDisplayPosition(), mediaManager.getValue().getCurrentAudioQueueDisplaySize()));
mCurrentDuration = ((Long) ((item.getRunTimeTicks() != null ? item.getRunTimeTicks() : 0) / 10000)).intValue();
//set progress to match duration
mCurrentProgress.setMax(mCurrentDuration);
Expand Down

0 comments on commit 4a2115f

Please sign in to comment.