Set artist and album

This commit is contained in:
Adrian Ulrich 2015-10-06 22:21:18 +02:00
parent 9de67792c7
commit e4855e51eb

View File

@ -88,11 +88,8 @@ public class RemoteControl {
remote.setPlaybackState(isPlaying ? RemoteControlClient.PLAYSTATE_PLAYING : RemoteControlClient.PLAYSTATE_PAUSED);
RemoteControlClient.MetadataEditor editor = remote.editMetadata(true);
if (song != null && song.id != -1) {
String artist_album = song.artist + " - " + song.album;
artist_album = (song.artist.length() == 0 ? song.album : artist_album); // no artist ? -> only display album
artist_album = (song.album.length() == 0 ? song.artist : artist_album); // no album ? -> only display artist
editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, artist_album);
editor.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, song.artist);
editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, song.album);
editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, song.title);
Bitmap bitmap = song.getCover(context);
if (bitmap != null && (isPlaying || keepPaused)) {