From be7df5704a6f4c3e027d706089f23f1c243f594b Mon Sep 17 00:00:00 2001 From: Dan Journo Date: Sun, 10 Nov 2024 21:01:40 +0000 Subject: [PATCH] Add Now Playing to Title Bar --- src/components/nowPlayingBar/nowPlayingBar.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/nowPlayingBar/nowPlayingBar.js b/src/components/nowPlayingBar/nowPlayingBar.js index 9c3bdaca408..43472d386da 100644 --- a/src/components/nowPlayingBar/nowPlayingBar.js +++ b/src/components/nowPlayingBar/nowPlayingBar.js @@ -527,7 +527,7 @@ function imageUrl(item, options) { function updateNowPlayingInfo(state) { const nowPlayingItem = state.NowPlayingItem; - + var documentTitle = "Jellyfin"; const textLines = nowPlayingItem ? nowPlayingHelper.getNowPlayingNames(nowPlayingItem) : []; nowPlayingTextElement.innerHTML = ''; if (textLines) { @@ -539,6 +539,7 @@ function updateNowPlayingInfo(state) { if (textLines[1].text) { const text = document.createElement('a'); text.innerText = textLines[1].text; + documentTitle = text.innerText; secondaryText.appendChild(text); } } @@ -546,12 +547,19 @@ function updateNowPlayingInfo(state) { if (textLines[0].text) { const text = document.createElement('a'); text.innerText = textLines[0].text; + if(documentTitle != "Jellyfin"){ + documentTitle +=' - '; + } + documentTitle += text.innerText; itemText.appendChild(text); } + nowPlayingTextElement.appendChild(itemText); nowPlayingTextElement.appendChild(secondaryText); } + document.title = documentTitle; + const imgHeight = 70; const url = nowPlayingItem ? (seriesImageUrl(nowPlayingItem, {