From 9cba01963fd2ee4b3718dbe10abcf5b42f56776a Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Wed, 15 Apr 2020 10:21:58 +0200 Subject: [PATCH] Fix code smell in mediasession --- src/components/playback/mediasession.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/playback/mediasession.js b/src/components/playback/mediasession.js index 65a61b91c8..8851601bdc 100644 --- a/src/components/playback/mediasession.js +++ b/src/components/playback/mediasession.js @@ -117,13 +117,9 @@ import connectionManager from 'connectionManager'; artwork: getImageUrls(item) }); } else { - let imageUrl = []; - imageUrl.push(pushImageUrl(item)); - - if (imageUrl.length) { - imageUrl = imageUrl[0].src; - } else { - imageUrl = null; + let itemImageUrl = seriesImageUrl(item) || imageUrl(item); + if (!itemImageUrl) { + itemImageUrl = null; } window.NativeShell.updateMediaSession({ @@ -135,7 +131,7 @@ import connectionManager from 'connectionManager'; album: album, duration: duration, position: currentTime, - imageUrl: imageUrl, + imageUrl: itemImageUrl, canSeek: canSeek, isPaused: isPaused });