[Refactor] Improve overlay image creation logic for small logs and translations

This commit is contained in:
misyaguziya
2025-06-16 11:29:54 +09:00
parent ab5c6b7bb5
commit e25cd62891
3 changed files with 51 additions and 17 deletions

View File

@@ -432,11 +432,23 @@ 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_MESSAGES is True and len(translation) > 0:
overlay_image = model.createOverlayImageSmallLog(translation[0], "")
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True:
if len(translation) > 0:
overlay_image = model.createOverlayImageSmallLog(
None,
None,
translation,
config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO],
)
model.updateOverlaySmallLog(overlay_image)
else:
overlay_image = model.createOverlayImageSmallLog(message, translation[0] if len(translation) > 0 else "")
model.updateOverlaySmallLog(overlay_image)
overlay_image = model.createOverlayImageSmallLog(
message,
language,
translation,
config.SELECTED_YOUR_LANGUAGES[config.SELECTED_TAB_NO],
)
model.updateOverlaySmallLog(overlay_image)
if config.OVERLAY_LARGE_LOG is True and model.overlay.initialized is True:
if config.OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES is True: