diff options
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/kvmd/server.py | 8 | ||||
-rw-r--r-- | kvmd/apps/kvmd/streamer.py | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py index d88982aa..893f95c3 100644 --- a/kvmd/apps/kvmd/server.py +++ b/kvmd/apps/kvmd/server.py @@ -206,13 +206,15 @@ class KvmdServer(HttpServer): # pylint: disable=too-many-arguments,too-many-ins @exposed_http("POST", "/streamer/set_params") async def __streamer_set_params_handler(self, request: aiohttp.web.Request) -> aiohttp.web.Response: + current_params = self.__streamer.get_params() for (name, validator) in [ ("quality", valid_stream_quality), ("desired_fps", valid_stream_fps), ]: - value = request.query.get(name) - if value: - self.__new_streamer_params[name] = validator(value) + if (value := request.query.get(name)): + value = validator(value) + if current_params[name] != value: + self.__new_streamer_params[name] = value await self.__streamer_notifier.notify() return make_json_response() diff --git a/kvmd/apps/kvmd/streamer.py b/kvmd/apps/kvmd/streamer.py index 98b5ae0c..5f2d2b42 100644 --- a/kvmd/apps/kvmd/streamer.py +++ b/kvmd/apps/kvmd/streamer.py @@ -173,6 +173,9 @@ class Streamer: # pylint: disable=too-many-instance-attributes ] } + def get_params(self) -> Dict: + return dict(self.__params) + async def get_state(self) -> Dict: state = None if self.__streamer_task: |