Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Now Playing to Title Bar #6312

Closed
Closed
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
10 changes: 9 additions & 1 deletion src/components/nowPlayingBar/nowPlayingBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@

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

var documentTitle = "Jellyfin";

Check failure on line 530 in src/components/nowPlayingBar/nowPlayingBar.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Unexpected var, use let or const instead

Check failure on line 530 in src/components/nowPlayingBar/nowPlayingBar.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Strings must use singlequote
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected var, use let or const instead. no-var

Fix available:

Suggested change
var documentTitle = "Jellyfin";
let documentTitle = "Jellyfin";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings must use singlequote. @stylistic/quotes

Fix available:

Suggested change
var documentTitle = "Jellyfin";
var documentTitle = 'Jellyfin';

const textLines = nowPlayingItem ? nowPlayingHelper.getNowPlayingNames(nowPlayingItem) : [];
nowPlayingTextElement.innerHTML = '';
if (textLines) {
Expand All @@ -539,19 +539,27 @@
if (textLines[1].text) {
const text = document.createElement('a');
text.innerText = textLines[1].text;
documentTitle = text.innerText;
secondaryText.appendChild(text);
}
}

if (textLines[0].text) {
const text = document.createElement('a');
text.innerText = textLines[0].text;
if(documentTitle != "Jellyfin"){

Check failure on line 550 in src/components/nowPlayingBar/nowPlayingBar.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Expected space(s) after "if"

Check failure on line 550 in src/components/nowPlayingBar/nowPlayingBar.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Strings must use singlequote

Check failure on line 550 in src/components/nowPlayingBar/nowPlayingBar.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Missing space before opening brace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected space(s) after "if". @stylistic/keyword-spacing

Fix available:

Suggested change
if(documentTitle != "Jellyfin"){
if (documentTitle != "Jellyfin"){

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings must use singlequote. @stylistic/quotes

Fix available:

Suggested change
if(documentTitle != "Jellyfin"){
if(documentTitle != 'Jellyfin'){

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace. @stylistic/space-before-blocks

Fix available:

Suggested change
if(documentTitle != "Jellyfin"){
if(documentTitle != "Jellyfin") {

documentTitle +=' - ';

Check failure on line 551 in src/components/nowPlayingBar/nowPlayingBar.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Operator '+=' must be spaced
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operator '+=' must be spaced. @stylistic/space-infix-ops

Fix available:

Suggested change
documentTitle +=' - ';
documentTitle += ' - ';

}
documentTitle += text.innerText;
itemText.appendChild(text);
}

nowPlayingTextElement.appendChild(itemText);
nowPlayingTextElement.appendChild(secondaryText);
}

document.title = documentTitle;

const imgHeight = 70;

const url = nowPlayingItem ? (seriesImageUrl(nowPlayingItem, {
Expand Down
Loading