mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Merge branch 'master' into subsonic-folder
This commit is contained in:
commit
1d593084bb
@ -60,7 +60,7 @@ func (pub *Router) handleImages(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
defer imgReader.Close()
|
||||
w.Header().Set("Cache-Control", "public, max-age=315360000")
|
||||
w.Header().Set("Last-Modified", lastUpdate.Format(time.RFC1123))
|
||||
w.Header().Set("Last-Modified", lastUpdate.Format(http.TimeFormat))
|
||||
cnt, err := io.Copy(w, imgReader)
|
||||
if err != nil {
|
||||
log.Warn(ctx, "Error sending image", "count", cnt, err)
|
||||
|
||||
@ -81,7 +81,7 @@ func (api *Router) GetCoverArt(w http.ResponseWriter, r *http.Request) (*respons
|
||||
|
||||
defer imgReader.Close()
|
||||
w.Header().Set("cache-control", "public, max-age=315360000")
|
||||
w.Header().Set("last-modified", lastUpdate.Format(time.RFC1123))
|
||||
w.Header().Set("last-modified", lastUpdate.Format(http.TimeFormat))
|
||||
|
||||
cnt, err := io.Copy(w, imgReader)
|
||||
if err != nil {
|
||||
|
||||
1980
ui/package-lock.json
generated
1980
ui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -32,7 +32,7 @@
|
||||
"inflection": "^3.0.2",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"navidrome-music-player": "4.25.1",
|
||||
"navidrome-music-player": "4.25.2",
|
||||
"prop-types": "^15.8.1",
|
||||
"ra-data-json-server": "^3.19.12",
|
||||
"ra-i18n-polyglot": "^3.19.12",
|
||||
|
||||
@ -134,30 +134,24 @@ const reduceAddTracks = (state, { data }) => {
|
||||
}
|
||||
|
||||
const reducePlayNext = (state, { data }) => {
|
||||
const newTracks = Object.keys(data).map((id) => mapToAudioLists(data[id]))
|
||||
const newQueue = []
|
||||
const current = state.current || {}
|
||||
let foundPos = false
|
||||
let currentIndex = 0
|
||||
state.queue.forEach((item) => {
|
||||
newQueue.push(item)
|
||||
if (item.uuid === current.uuid) {
|
||||
foundPos = true
|
||||
currentIndex = newQueue.length - 1
|
||||
Object.keys(data).forEach((id) => {
|
||||
newQueue.push(mapToAudioLists(data[id]))
|
||||
})
|
||||
newQueue.push(...newTracks)
|
||||
}
|
||||
})
|
||||
if (!foundPos) {
|
||||
Object.keys(data).forEach((id) => {
|
||||
newQueue.push(mapToAudioLists(data[id]))
|
||||
})
|
||||
newQueue.push(...newTracks)
|
||||
}
|
||||
|
||||
return {
|
||||
...state,
|
||||
queue: newQueue,
|
||||
playIndex: foundPos ? currentIndex : undefined,
|
||||
clear: true,
|
||||
}
|
||||
}
|
||||
@ -170,14 +164,18 @@ const reduceSetVolume = (state, { data: { volume } }) => {
|
||||
}
|
||||
|
||||
const reduceSyncQueue = (state, { data: { audioInfo, audioLists } }) => {
|
||||
// Only keep clear and playIndex alive when there is an actual pending
|
||||
// track switch (playIndex differs from savedPlayIndex). This lets
|
||||
// PLAYER_PLAY_TRACKS selections survive the sync, while allowing
|
||||
// PLAYER_PLAY_NEXT (which sets playIndex to the current track) to
|
||||
// reset immediately and avoid restarting playback.
|
||||
const hasPendingSwitch =
|
||||
state.playIndex != null && state.playIndex !== state.savedPlayIndex
|
||||
return {
|
||||
...state,
|
||||
queue: audioLists,
|
||||
// Keep clear and playIndex alive so the music player can still
|
||||
// pick up a pending track selection set by PLAYER_PLAY_TRACKS.
|
||||
// They will be consumed by the next PLAYER_CURRENT dispatch.
|
||||
clear: state.playIndex != null ? state.clear : false,
|
||||
playIndex: state.playIndex != null ? state.playIndex : undefined,
|
||||
clear: hasPendingSwitch ? state.clear : false,
|
||||
playIndex: hasPendingSwitch ? state.playIndex : undefined,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user