mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-01 07:21:17 +00:00
fix: address code review feedback
- Qualify rating column as annotation.rating to prevent SQL ambiguity - Remove DOM audio manipulation anti-pattern; rely on queue update to advance playback - Remove hardcoded autoPlay: false in PLAYER_REMOVE_FROM_QUEUE to preserve playback state Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ac723fccd5
commit
9cfa3eaaab
@ -50,7 +50,7 @@ func notDislikedFilter(_ string, value any) Sqlizer {
|
||||
return nil
|
||||
}
|
||||
if strings.ToLower(v) == "true" {
|
||||
return NotEq{"COALESCE(rating, 0)": 1}
|
||||
return NotEq{"COALESCE(annotation.rating, 0)": 1}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ func SongsByRandom(genre string, fromYear, toYear int) Options {
|
||||
}
|
||||
|
||||
func NotDisliked() Sqlizer {
|
||||
return NotEq{"COALESCE(rating, 0)": 1}
|
||||
return NotEq{"COALESCE(annotation.rating, 0)": 1}
|
||||
}
|
||||
|
||||
func SongsByArtistTitleWithLyricsFirst(artist, title string) Options {
|
||||
|
||||
@ -70,12 +70,6 @@ export const useRating = (resource, record) => {
|
||||
const inQueue = queue.some((item) => item.trackId === trackId)
|
||||
if (val === 1 && inQueue) {
|
||||
dispatch(removeFromQueue(trackId))
|
||||
if (current?.trackId === trackId) {
|
||||
const audio = document.querySelector('audio')
|
||||
if (audio) {
|
||||
audio.dispatchEvent(new Event('ended'))
|
||||
}
|
||||
}
|
||||
} else if (rating === 1 && val !== 1 && !inQueue && queue.length < 500) {
|
||||
dispatch(addTracks({ [trackId]: record }))
|
||||
}
|
||||
|
||||
@ -251,7 +251,6 @@ export const playerReducer = (previousState = initialState, payload) => {
|
||||
...previousState,
|
||||
queue: previousState.queue.filter((item) => item.trackId !== payload.data),
|
||||
clear: true,
|
||||
autoPlay: false,
|
||||
}
|
||||
default:
|
||||
return previousState
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user