-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #6314
base: master
Are you sure you want to change the base?
Conversation
Cloudflare Pages deployment
|
Quality Gate passedIssues Measures |
Are we talking about the window / tab / document title here? Because that's what the code points to, but the screenshot of the issue seems to show something different. Also I don't like the technical solution of mixing the document title management into this existing function. To make things easy to understand, manage and test, this should be separated. Additionally hard-coded strings are an anti-pattern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did find some bugs:
- The title will not be reset after playback is stopped.
- While playing something, moving between library pages will reset the title.
nowPlayingTextElement.appendChild(itemText); | ||
nowPlayingTextElement.appendChild(secondaryText); | ||
} | ||
|
||
document.title = documentTitle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document.title = documentTitle; | |
document.title = documentTitle || 'Jellyfin'; |
We can set documentTitle
to initially be an empty string for improved readability.
@@ -539,19 +539,27 @@ function updateNowPlayingInfo(state) { | |||
if (textLines[1].text) { | |||
const text = document.createElement('a'); | |||
text.innerText = textLines[1].text; | |||
documentTitle = text.innerText; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does currently show Year - Movie Name
for movies and Episode Number - Episode Name - Series
for episodes. Not sure if this is how we should go about it, maybe someone else can give suggestions.
Changes
Add Media Playing to Title Bar
Issues
Resolves #6301