Recursively refresh playlist tracks within smart playlist rules (#3018)
* Recursively refresh playlists within smart playlist rules Signed-off-by: reillymc <reilly@mackenzie-cree.net> * Clean up recursive smart playlist functions Signed-off-by: reillymc <reilly@mackenzie-cree.net> * Add smart playlist refresh timeout config and tests for nested track refetching Signed-off-by: reillymc <reilly@mackenzie-cree.net> * Change SmartPlaylistRefreshTimeout to SmartPlaylistRefreshDelay, increase default value * Revert `smartPlaylistRefreshDelay` default to 5 seconds --------- Signed-off-by: reillymc <reilly@mackenzie-cree.net> Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
committed by
GitHub
parent
180035c1e3
commit
d683688b0e
@@ -50,6 +50,21 @@ func (c Criteria) ToSql() (sql string, args []interface{}, err error) {
|
||||
return c.Expression.ToSql()
|
||||
}
|
||||
|
||||
func (c Criteria) ChildPlaylistIds() (ids []string) {
|
||||
if c.Expression == nil {
|
||||
return ids
|
||||
}
|
||||
|
||||
switch rules := c.Expression.(type) {
|
||||
case Any:
|
||||
ids = rules.ChildPlaylistIds()
|
||||
case All:
|
||||
ids = rules.ChildPlaylistIds()
|
||||
}
|
||||
|
||||
return ids
|
||||
}
|
||||
|
||||
func (c Criteria) MarshalJSON() ([]byte, error) {
|
||||
aux := struct {
|
||||
All []Expression `json:"all,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user