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:
Finomosec 2026-06-01 14:57:51 +02:00
parent ac723fccd5
commit 9cfa3eaaab
4 changed files with 2 additions and 9 deletions

View File

@ -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
}

View File

@ -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 {

View File

@ -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 }))
}

View File

@ -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