get-filter-from-target: Don't bypass the hook if the session item is a regular filter

Regular filters should be treated as regular stream / device nodes. Note that
the filter utils API is meant to be used using the direction of the main smart
filter nodes. This is why we use the target direction instead of the actual
stream direction to check if the stream session item is smart or not.
This commit is contained in:
Julian Bouzas 2024-06-25 14:15:46 -04:00
parent fa67121665
commit 4868b3c336

View file

@ -28,11 +28,13 @@ SimpleEventHook {
return
end
-- bypass the hook if the session item is a filter
-- bypass the hook if the session item is a smart filter
local node = si:get_associated_proxy ("node")
local node_props = node.properties
local link_group = node_props ["node.link-group"]
if link_group ~= nil then
local target_direction = cutils.getTargetDirection (si.properties)
if link_group ~= nil and
futils.is_filter_smart (target_direction, link_group) then
return
end
@ -40,7 +42,6 @@ SimpleEventHook {
local target_node = target:get_associated_proxy ("node")
local target_node_props = target_node.properties
local target_link_group = target_node_props ["node.link-group"]
local target_direction = cutils.getTargetDirection (si.properties)
if target_link_group ~= nil and si_flags.has_defined_target then
if futils.is_filter_smart (target_direction, target_link_group) and
not futils.is_filter_disabled (target_direction, target_link_group) and
@ -51,7 +52,6 @@ SimpleEventHook {
-- Get the filter from the given target if it exists, otherwise get the
-- default filter, but only if target was not defined
local target_direction = cutils.getTargetDirection (si.properties)
local media_type = si_props["media.type"]
local filter_target = futils.get_filter_from_target (target_direction, media_type, target)
if filter_target ~= nil then