T-576 增加生成和更新内容模式
This commit is contained in:
+9
-1
@@ -1411,7 +1411,7 @@ def _confirm_update_modal(cdp, timeout=3):
|
||||
return last_present or {"present": False, "clicked": False, "reason": "NO_UPDATE_CONFIRM_MODAL"}
|
||||
|
||||
|
||||
def apply_task(account, task, close_success_tab=False, on_step=None, bring_to_front=True) -> dict:
|
||||
def apply_task(account, task, close_success_tab=False, on_step=None, bring_to_front=True, update_mode=None) -> dict:
|
||||
"""Apply generated title/cover to Shopee.
|
||||
|
||||
The caller must perform the batch confirmation before calling this function.
|
||||
@@ -1426,8 +1426,16 @@ def apply_task(account, task, close_success_tab=False, on_step=None, bring_to_fr
|
||||
try:
|
||||
title_result = None
|
||||
cover_result = None
|
||||
mode = appconfig.normalize_update_mode(
|
||||
update_mode,
|
||||
allow_cover_update=bool(_get(task, "new_cover_path")),
|
||||
)
|
||||
new_title = _get(task, "new_title")
|
||||
new_cover_path = _get(task, "new_cover_path")
|
||||
if not appconfig.update_mode_includes_title(mode):
|
||||
new_title = None
|
||||
if not appconfig.update_mode_includes_cover(mode):
|
||||
new_cover_path = None
|
||||
if new_title:
|
||||
current_step = "change_title"
|
||||
_notify_apply_step(on_step, current_step, "start")
|
||||
|
||||
Reference in New Issue
Block a user