diff --git a/actions/Filter/FilterBase.py b/actions/Filter/FilterBase.py index df0dd39..2dad4e4 100644 --- a/actions/Filter/FilterBase.py +++ b/actions/Filter/FilterBase.py @@ -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) diff --git a/backend/OBSController.py b/backend/OBSController.py index 53c647d..a106282 100644 --- a/backend/OBSController.py +++ b/backend/OBSController.py @@ -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 @@ -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)