👍️[Update] Model : overlay_show_only_translated_messagesのendpointを追加

This commit is contained in:
misyaguziya
2024-12-02 11:15:10 +09:00
parent c0942b0fbc
commit bf49715209
3 changed files with 31 additions and 12 deletions

View File

@@ -251,7 +251,7 @@ class Controller:
model.logger.info(f"[SENT] {message}{translation}")
if config.OVERLAY_LARGE_LOG is True and model.overlay.initialized is True:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGE is True and len(translation) > 0:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True and len(translation) > 0:
overlay_image = model.createOverlayImageLargeLog("send", translation[0], "")
else:
overlay_image = model.createOverlayImageLargeLog("send", message, translation[0] if len(translation) > 0 else "")
@@ -293,14 +293,14 @@ class Controller:
if config.ENABLE_TRANSCRIPTION_RECEIVE is True:
if config.OVERLAY_SMALL_LOG is True and model.overlay.initialized is True:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGE is True and len(translation) > 0:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True and len(translation) > 0:
overlay_image = model.createOverlayImageSmallLog(translation[0], "")
else:
overlay_image = model.createOverlayImageSmallLog(message, translation[0] if len(translation) > 0 else "")
model.updateOverlaySmallLog(overlay_image)
if config.OVERLAY_LARGE_LOG is True and model.overlay.initialized is True:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGE is True and len(translation) > 0:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True and len(translation) > 0:
overlay_image = model.createOverlayImageLargeLog("receive", translation[0], "")
else:
overlay_image = model.createOverlayImageLargeLog("receive", message, translation[0] if len(translation) > 0 else "")
@@ -370,7 +370,7 @@ class Controller:
model.oscSendMessage(osc_message)
if config.OVERLAY_LARGE_LOG is True:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGE is True and len(translation) > 0:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True and len(translation) > 0:
overlay_image = model.createOverlayImageLargeLog("send", translation[0], "")
else:
overlay_image = model.createOverlayImageLargeLog("send", message, translation[0] if len(translation) > 0 else "")
@@ -1240,6 +1240,20 @@ class Controller:
model.updateOverlayLargeLogSettings()
return {"status":200, "result":config.OVERLAY_LARGE_LOG_SETTINGS}
@staticmethod
def getOverlayShowOnlyTranslatedMessages(*args, **kwargs) -> dict:
return {"status":200, "result":config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES}
@staticmethod
def setEnableOverlayShowOnlyTranslatedMessages(*args, **kwargs) -> dict:
config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES = True
return {"status":200, "result":config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES}
@staticmethod
def setDisableOverlayShowOnlyTranslatedMessages(*args, **kwargs) -> dict:
config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES = False
return {"status":200, "result":config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES}
@staticmethod
def getSendMessageToVrc(*args, **kwargs) -> dict:
return {"status":200, "result":config.SEND_MESSAGE_TO_VRC}