mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-09 11:52:35 +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)
|
const item = queue.queue.find((item) => item.id === info.id)
|
||||||
if (item && !item.scrobbled) {
|
if (item && !item.scrobbled) {
|
||||||
dispatch(scrobble(info.id))
|
dispatch(scrobble(info.id))
|
||||||
fetchUtils.fetchJson(
|
fetchUtils.fetchJson(info.scrobble(true))
|
||||||
`/rest/scrobble?u=admin&jwt=${localStorage.getItem(
|
|
||||||
'token'
|
|
||||||
)}&f=json&v=1.8.0&c=NavidromeUI&id=${info.id}&submission=true`
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const OnAudioPlay = (info) => {
|
const OnAudioPlay = (info) => {
|
||||||
if (info.duration) {
|
if (info.duration) {
|
||||||
fetchUtils.fetchJson(
|
fetchUtils.fetchJson(info.scrobble(false))
|
||||||
`/rest/scrobble?u=admin&jwt=${localStorage.getItem(
|
|
||||||
'token'
|
|
||||||
)}&f=json&v=1.8.0&c=NavidromeUI&id=${info.id}&submission=false`
|
|
||||||
)
|
|
||||||
dataProvider.getOne('keepalive', { id: info.id })
|
dataProvider.getOne('keepalive', { id: info.id })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,11 @@ const mapToAudioLists = (item) => ({
|
|||||||
}&jwt=${localStorage.getItem('token')}`,
|
}&jwt=${localStorage.getItem('token')}`,
|
||||||
musicSrc: `/rest/stream?u=admin&f=json&v=1.8.0&c=NavidromeUI&jwt=${localStorage.getItem(
|
musicSrc: `/rest/stream?u=admin&f=json&v=1.8.0&c=NavidromeUI&jwt=${localStorage.getItem(
|
||||||
'token'
|
'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) => ({
|
const addTrack = (data) => ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user