mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 04:00:38 +03:00
refactor: put all subsonic client URLs together
This commit is contained in:
parent
abb99a8501
commit
d9dd9fe587
@ -56,21 +56,13 @@ const Player = () => {
|
||||
const item = queue.queue.find((item) => item.id === info.id)
|
||||
if (item && !item.scrobbled) {
|
||||
dispatch(scrobble(info.id))
|
||||
fetchUtils.fetchJson(
|
||||
`/rest/scrobble?u=admin&jwt=${localStorage.getItem(
|
||||
'token'
|
||||
)}&f=json&v=1.8.0&c=NavidromeUI&id=${info.id}&submission=true`
|
||||
)
|
||||
fetchUtils.fetchJson(info.scrobble(true))
|
||||
}
|
||||
}
|
||||
|
||||
const OnAudioPlay = (info) => {
|
||||
if (info.duration) {
|
||||
fetchUtils.fetchJson(
|
||||
`/rest/scrobble?u=admin&jwt=${localStorage.getItem(
|
||||
'token'
|
||||
)}&f=json&v=1.8.0&c=NavidromeUI&id=${info.id}&submission=false`
|
||||
)
|
||||
fetchUtils.fetchJson(info.scrobble(false))
|
||||
dataProvider.getOne('keepalive', { id: info.id })
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,11 @@ const mapToAudioLists = (item) => ({
|
||||
}&jwt=${localStorage.getItem('token')}`,
|
||||
musicSrc: `/rest/stream?u=admin&f=json&v=1.8.0&c=NavidromeUI&jwt=${localStorage.getItem(
|
||||
'token'
|
||||
)}&id=${item.id}&_=${new Date().getTime()}`
|
||||
)}&id=${item.id}&_=${new Date().getTime()}`,
|
||||
scrobble: (submit) =>
|
||||
`/rest/scrobble?u=admin&jwt=${localStorage.getItem(
|
||||
'token'
|
||||
)}&f=json&v=1.8.0&c=NavidromeUI&id=${item.id}&submission=${submit}`
|
||||
})
|
||||
|
||||
const addTrack = (data) => ({
|
||||
|
Loading…
x
Reference in New Issue
Block a user