From 813f2d20f9573aea96bc1da77d4d44d26b160847 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Tue, 17 Dec 2024 00:19:50 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8D=EF=B8=8F[Update]=20Controller=20:?= =?UTF-8?q?=20=E3=83=95=E3=83=A9=E3=82=B0=E3=81=AEON/OFF=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=9F=E3=83=B3=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_controller.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 06ab8016..ece8198d 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -449,9 +449,9 @@ class Controller: @staticmethod def setEnableTranslation(*args, **kwargs) -> dict: - config.ENABLE_TRANSLATION = True if model.isLoadedCTranslate2Model() is False: model.changeTranslatorCTranslate2Model() + config.ENABLE_TRANSLATION = True return {"status":200, "result":config.ENABLE_TRANSLATION} @staticmethod @@ -1087,6 +1087,7 @@ class Controller: th_callback = Thread(target=callback) th_callback.daemon = True th_callback.start() + th_callback.join() return {"status":200, "result":config.CTRANSLATE2_WEIGHT_TYPE} @staticmethod @@ -1149,10 +1150,9 @@ class Controller: @staticmethod def setDisableOverlaySmallLog(*args, **kwargs) -> dict: config.OVERLAY_SMALL_LOG = False - if config.OVERLAY_SMALL_LOG is False: - model.clearOverlayImageSmallLog() - if config.OVERLAY_LARGE_LOG is False: - model.shutdownOverlay() + model.clearOverlayImageSmallLog() + if config.OVERLAY_LARGE_LOG is False: + model.shutdownOverlay() return {"status":200, "result":config.OVERLAY_SMALL_LOG} @staticmethod @@ -1179,10 +1179,9 @@ class Controller: @staticmethod def setDisableOverlayLargeLog(*args, **kwargs) -> dict: config.OVERLAY_LARGE_LOG = False - if config.OVERLAY_LARGE_LOG is False: - model.clearOverlayImageLargeLog() - if config.OVERLAY_SMALL_LOG is False: - model.shutdownOverlay() + model.clearOverlayImageLargeLog() + if config.OVERLAY_SMALL_LOG is False: + model.shutdownOverlay() return {"status":200, "result":config.OVERLAY_LARGE_LOG} @staticmethod