mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-15 11:40:36 +03:00
Add track/artist being played to the page title. Closes #317
This commit is contained in:
parent
c742ae0843
commit
4702c5abbd
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user