Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/nowPlayingBar/nowPlayingBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import appFooter from '../appFooter/appFooter';
import itemShortcuts from '../shortcuts';
import './nowPlayingBar.scss';
import '../../elements/emby-slider/emby-slider';
import LibraryMenu from 'scripts/libraryMenu';

let currentPlayer;
let currentPlayerSupportedCommands = [];
Expand Down Expand Up @@ -474,6 +475,7 @@ function setLyricButtonActiveStatus() {
}

function updateNowPlayingInfo(state) {
let newTitle;
const nowPlayingItem = state.NowPlayingItem;

const textLines = nowPlayingItem ? getItemTextLines(nowPlayingItem) : undefined;
Expand All @@ -485,18 +487,26 @@ function updateNowPlayingInfo(state) {
if (textLines.length > 1 && textLines[1]) {
const text = document.createElement('a');
text.innerText = textLines[1];
newTitle = textLines[1];
secondaryText.appendChild(text);
}

if (textLines[0]) {
const text = document.createElement('a');
text.innerText = textLines[0];
itemText.appendChild(text);

if (newTitle) {
newTitle += ' - ';
}

newTitle += text.innerText;
}
nowPlayingTextElement.appendChild(itemText);
nowPlayingTextElement.appendChild(secondaryText);
}

document.title = newTitle || LibraryMenu.setDefaultTitle();
const imgHeight = 70;

const url = nowPlayingItem ? getImageUrl(nowPlayingItem, {
Expand Down Expand Up @@ -612,6 +622,7 @@ function hideNowPlayingBar() {
function onPlaybackStopped(e, state) {
console.debug('[nowPlayingBar:onPlaybackStopped] event: ' + e.type);

LibraryMenu.setDefaultTitle();
const player = this;

if (player.isLocalPlayer) {
Expand Down
Loading