T-576 增加生成和更新内容模式
This commit is contained in:
+13
-13
@@ -208,6 +208,7 @@ class SettingsTab(QWidget):
|
||||
self.allow_real_submit_checkbox.setObjectName("allowRealSubmitCheckbox")
|
||||
self.allow_cover_update_checkbox = QCheckBox("允许更新封面")
|
||||
self.allow_cover_update_checkbox.setObjectName("allowCoverUpdateCheckbox")
|
||||
self.allow_cover_update_checkbox.setVisible(False)
|
||||
self.max_items_per_run_spin = QSpinBox()
|
||||
self.max_items_per_run_spin.setObjectName("maxItemsPerRunSpin")
|
||||
self.max_items_per_run_spin.setRange(1, 9999)
|
||||
@@ -294,7 +295,6 @@ class SettingsTab(QWidget):
|
||||
("每批最大更新条数", self.max_items_per_run_spin),
|
||||
("", self.allow_real_submit_checkbox),
|
||||
("", self.close_success_tab_checkbox),
|
||||
("", self.allow_cover_update_checkbox),
|
||||
("", self.parallel_accounts_group, 2),
|
||||
]
|
||||
)
|
||||
@@ -519,7 +519,6 @@ class SettingsTab(QWidget):
|
||||
self.cmhub_check_balance_checkbox,
|
||||
self.enabled_checkbox,
|
||||
self.allow_real_submit_checkbox,
|
||||
self.allow_cover_update_checkbox,
|
||||
self.close_success_tab_checkbox,
|
||||
self.parallel_accounts_checkbox,
|
||||
)
|
||||
@@ -780,6 +779,14 @@ class SettingsTab(QWidget):
|
||||
for key, value in self.config.items()
|
||||
if key not in {"config_path", "ai_models_path", "cmhub_config_path", "data_dir"}
|
||||
}
|
||||
try:
|
||||
current_update_cfg = appconfig.shopee_update_config(appconfig.load_config(self.config_path))
|
||||
except Exception:
|
||||
current_update_cfg = self._shopee_update_config()
|
||||
update_mode = appconfig.normalize_update_mode(
|
||||
current_update_cfg.get("update_mode"),
|
||||
allow_cover_update=current_update_cfg.get("allow_cover_update", False),
|
||||
)
|
||||
settings.update(
|
||||
{
|
||||
"chrome_path": self.chrome_path_edit.text().strip(),
|
||||
@@ -796,7 +803,8 @@ class SettingsTab(QWidget):
|
||||
"shopee_update": {
|
||||
"test_item_id": str(self._compat_test_item_id or ""),
|
||||
"allow_real_submit": self.allow_real_submit_checkbox.isChecked(),
|
||||
"allow_cover_update": self.allow_cover_update_checkbox.isChecked(),
|
||||
"allow_cover_update": appconfig.update_mode_includes_cover(update_mode),
|
||||
"update_mode": update_mode,
|
||||
"max_items_per_run": self.max_items_per_run_spin.value(),
|
||||
"close_success_tab": self.close_success_tab_checkbox.isChecked(),
|
||||
"dry_run": False,
|
||||
@@ -912,9 +920,7 @@ class SettingsTab(QWidget):
|
||||
self.allow_real_submit_checkbox.setChecked(
|
||||
bool(update_cfg.get("allow_real_submit", False))
|
||||
)
|
||||
self.allow_cover_update_checkbox.setChecked(
|
||||
bool(update_cfg.get("allow_cover_update", False))
|
||||
)
|
||||
self.allow_cover_update_checkbox.setChecked(bool(update_cfg.get("allow_cover_update", False)))
|
||||
self.max_items_per_run_spin.setValue(
|
||||
max(1, int(update_cfg.get("max_items_per_run", 1) or 1))
|
||||
)
|
||||
@@ -931,13 +937,7 @@ class SettingsTab(QWidget):
|
||||
self._on_backend_changed()
|
||||
|
||||
def _shopee_update_config(self):
|
||||
defaults = appconfig.default_config().get("shopee_update", {})
|
||||
loaded = self.config.get("shopee_update", {})
|
||||
if not isinstance(loaded, dict):
|
||||
loaded = {}
|
||||
merged = dict(defaults)
|
||||
merged.update(loaded)
|
||||
return merged
|
||||
return appconfig.shopee_update_config(self.config)
|
||||
|
||||
def _populate_role_model_combos(self):
|
||||
ai_cfg = appconfig.ai_config(self.config)
|
||||
|
||||
Reference in New Issue
Block a user