Add track/artist being played to the page title. Closes #317

This commit is contained in:
Deluan 2020-06-11 22:40:35 -04:00
parent c742ae0843
commit 4702c5abbd

View File

@ -93,12 +93,17 @@ const Player = () => {
const OnAudioPlay = (info) => {
if (info.duration) {
document.title = `${info.name} - ${info.singer} - Navidrome`
dispatch(scrobble(info.trackId, false))
subsonic.scrobble(info.trackId, false)
dataProvider.getOne('keepalive', { id: info.trackId })
}
}
const onAudioEnded = () => {
document.title = 'Navidrome'
}
if (authenticated && options.audioLists.length > 0) {
return (
<ReactJkMusicPlayer
@ -106,9 +111,11 @@ const Player = () => {
onAudioListsChange={OnAudioListsChange}
onAudioProgress={OnAudioProgress}
onAudioPlay={OnAudioPlay}
onAudioEnded={onAudioEnded}
/>
)
}
document.title = 'Navidrome'
return null
}