From fd55eb99ac960d248f1dce32684719b2b790e8f7 Mon Sep 17 00:00:00 2001 From: Mariusz Chryc Date: Wed, 29 Jul 2020 17:49:07 +0200 Subject: [PATCH] Fix updateNowPlayingInfo when artist or album are empty --- src/components/remotecontrol/remotecontrol.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/remotecontrol/remotecontrol.js b/src/components/remotecontrol/remotecontrol.js index db2bed36a7..24e58404d8 100644 --- a/src/components/remotecontrol/remotecontrol.js +++ b/src/components/remotecontrol/remotecontrol.js @@ -119,9 +119,9 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL var nowPlayingServerId = (item.ServerId || serverId); if (item.Type == 'Audio' || item.MediaStreams[0].Type == 'Audio') { var songName = item.Name; - if (item.Album != null && item.Artists != null) { - var artistsSeries = ''; - var albumName = item.Album; + var artistsSeries = ''; + var albumName = ''; + if (item.Artists != null) { if (item.ArtistItems != null) { for (const artist of item.ArtistItems) { let artistName = artist.Name; @@ -142,9 +142,12 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL } } } - context.querySelector('.nowPlayingArtist').innerHTML = artistsSeries; - context.querySelector('.nowPlayingAlbum').innerHTML = '${albumName}`; } + if (item.Album != null){ + albumName = '` + item.Album + ``; + } + context.querySelector('.nowPlayingAlbum').innerHTML = albumName + context.querySelector('.nowPlayingArtist').innerHTML = artistsSeries; context.querySelector('.nowPlayingSongName').innerHTML = songName; } else if (item.Type == 'Episode') { if (item.SeasonName != null) {