Add track/artist being played to the page title. Closes #317
This commit is contained in:
parent
c742ae0843
commit
4702c5abbd
1 changed files with 7 additions and 0 deletions
|
|
@ -93,12 +93,17 @@ const Player = () => {
|
||||||
|
|
||||||
const OnAudioPlay = (info) => {
|
const OnAudioPlay = (info) => {
|
||||||
if (info.duration) {
|
if (info.duration) {
|
||||||
|
document.title = `${info.name} - ${info.singer} - Navidrome`
|
||||||
dispatch(scrobble(info.trackId, false))
|
dispatch(scrobble(info.trackId, false))
|
||||||
subsonic.scrobble(info.trackId, false)
|
subsonic.scrobble(info.trackId, false)
|
||||||
dataProvider.getOne('keepalive', { id: info.trackId })
|
dataProvider.getOne('keepalive', { id: info.trackId })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onAudioEnded = () => {
|
||||||
|
document.title = 'Navidrome'
|
||||||
|
}
|
||||||
|
|
||||||
if (authenticated && options.audioLists.length > 0) {
|
if (authenticated && options.audioLists.length > 0) {
|
||||||
return (
|
return (
|
||||||
<ReactJkMusicPlayer
|
<ReactJkMusicPlayer
|
||||||
|
|
@ -106,9 +111,11 @@ const Player = () => {
|
||||||
onAudioListsChange={OnAudioListsChange}
|
onAudioListsChange={OnAudioListsChange}
|
||||||
onAudioProgress={OnAudioProgress}
|
onAudioProgress={OnAudioProgress}
|
||||||
onAudioPlay={OnAudioPlay}
|
onAudioPlay={OnAudioPlay}
|
||||||
|
onAudioEnded={onAudioEnded}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
document.title = 'Navidrome'
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue