mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-18 07:30:29 +00:00
fix(smartplaylists): stop warning on every inPlaylist rule without the looked-up field
Rules that reference a playlist by id have no path field, and the reverse, so the warning fired on every refresh. The log call also had a bad argument count.
This commit is contained in:
parent
5d3fcaa458
commit
c5a262a5e0
@ -1,7 +1,5 @@
|
||||
package criteria
|
||||
|
||||
import "github.com/navidrome/navidrome/log"
|
||||
|
||||
// Conjunctions need to implement this interface, to allow Criteria to extract child playlist IDs recursively
|
||||
type conjunction interface {
|
||||
ChildPlaylistIds() []string
|
||||
@ -192,17 +190,9 @@ func extractPlaylistField(inputRule any, field string) (values []string) {
|
||||
for _, rules := range rule {
|
||||
values = append(values, extractPlaylistField(rules, field)...)
|
||||
}
|
||||
case InPlaylist:
|
||||
if value, ok := rule[field].(string); ok {
|
||||
case InPlaylist, NotInPlaylist:
|
||||
if value, ok := rule.(Expression).fields()[field].(string); ok {
|
||||
values = append(values, value)
|
||||
} else {
|
||||
log.Warn("Playlist field not a string", field)
|
||||
}
|
||||
case NotInPlaylist:
|
||||
if value, ok := rule[field].(string); ok {
|
||||
values = append(values, value)
|
||||
} else {
|
||||
log.Warn("Playlist field not a string", field)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user