filter-utils.lua: Restrict smart filters to nodes that are not part of any collection

Smart filters are not meant to be used with collection specific policy.
This commit is contained in:
Julian Bouzas 2025-12-16 14:35:39 -05:00
parent 7981fa2b2d
commit bbd2f89289

View file

@ -129,7 +129,10 @@ local function getFilterSmartTarget (metadata, node, om)
-- Find target
local target = nil
for si_target in om:iterate { type = "SiLinkable" } do
for si_target in om:iterate {
type = "SiLinkable",
Constraint { "collection.name", "-" },
} do
local n_target = si_target:get_associated_proxy ("node")
if n_target == nil then
goto skip_target
@ -291,7 +294,10 @@ local function rescanFilters (om, metadata_om)
Log.info ("rescanning filters...")
for si in om:iterate { type = "SiLinkable" } do
for si in om:iterate {
type = "SiLinkable",
Constraint { "collection.name", "-" },
} do
local filter = {}
local n = si:get_associated_proxy ("node")
@ -337,7 +343,8 @@ local function rescanFilters (om, metadata_om)
filter.stream_si = om:lookup {
type = "SiLinkable",
Constraint { "node.link-group", "=", filter.link_group },
Constraint { "media.class", "#", "Stream/*", type = "pw-global" }
Constraint { "media.class", "#", "Stream/*", type = "pw-global" },
Constraint { "collection.name", "-" },
}
-- Add the filter to the list sorted by before and after