Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion actions/Filter/FilterBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def show_current_filter_status(self):
return

status = self.backend.get_source_filter(self.get_settings().get("scene"), self.get_settings().get("filter"))
if status is None:
# The backend returns an empty dict (not None) when the scene or filter
# doesn't exist in the active scene collection; indexing it raises a
# KeyError over rpyc and logs a full traceback on every tick.
if not status or "filterEnabled" not in status:
self.current_state = State.UNKNOWN
self.hide_error()
self.show_for_state(State.UNKNOWN)
Expand Down
14 changes: 13 additions & 1 deletion backend/OBSController.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def __init__(self):
self._connected_state = False
self.event_obs: obsws = None # All events are connected to this to avoid crash if a request is made in an event
self.volume_meters = {}
# (scene, item) pairs already reported missing by get_scene_item_enabled.
# Every SceneItem action polls once per tick, so when the active scene
# collection doesn't contain the referenced scenes an unconditional
# warning floods the journal at one line per action per second.
self._missing_scene_items = set()
pass

@property
Expand Down Expand Up @@ -460,7 +465,14 @@ def get_scene_item_enabled(self, sceneName: str, sourceName: str) -> None:
return self.call(requests.GetSceneItemEnabled(sceneName=sceneName, sceneItemId=sceneItemId))
except Exception as e:
if str(e) == "'sceneItemId'":
log.warning("Cannot find the scene item!")
# Expected while another scene collection is active: warn once
# per pair instead of once per tick.
if (sceneName, sourceName) not in self._missing_scene_items:
self._missing_scene_items.add((sceneName, sourceName))
log.warning(
f"Cannot find scene item {sourceName!r} in scene "
f"{sceneName!r} -- suppressing repeats of this warning"
)
else:
log.error(e)

Expand Down