|
|
@@ -100,6 +100,7 @@ SETTINGS_FIELDS = [
|
|
|
('采集过滤', 'collect.filters.need_goods', '需挂车(无商品则过滤)', 'bool', True),
|
|
|
('采集', 'collect.poll_interval_sec', '轮询间隔(秒)', 'int', 300),
|
|
|
('发布', 'publish.fragment_mb', '分片大小(MB)', 'int', 8),
|
|
|
+ ('发布', 'publish.delay_sec', '发布步间延时(秒,如 30,180)', 'irange', [30, 180]),
|
|
|
('发布', 'publish.daily_limit_per_account', '单账号日发布上限', 'int', 5),
|
|
|
('AI生图', 'ai.model', '模型', 'str', 'cogview-3-flash'),
|
|
|
('AI生图', 'ai.image_size', '生图尺寸(WxH)', 'str', '1024x1024'),
|
|
|
@@ -156,6 +157,8 @@ def form_values(cfg):
|
|
|
vals[path] = '1' if v else '0'
|
|
|
elif typ == 'list':
|
|
|
vals[path] = ','.join(v)
|
|
|
+ elif typ == 'irange': # [a,b] → 'a,b'
|
|
|
+ vals[path] = ','.join(str(int(x)) for x in (v or []))
|
|
|
else:
|
|
|
vals[path] = str(v)
|
|
|
return vals
|
|
|
@@ -173,6 +176,10 @@ def apply_form(cfg, vals):
|
|
|
_bury(cfg, path, float(raw or 0))
|
|
|
elif typ == 'list':
|
|
|
_bury(cfg, path, [x.strip() for x in _LIST_SPLIT_RE.split(raw) if x.strip()])
|
|
|
+ elif typ == 'irange': # 'a,b' → [min(a,b), max(a,b)] 整数对
|
|
|
+ nums = [int(float(x)) for x in _LIST_SPLIT_RE.split(raw) if x.strip()]
|
|
|
+ pair = ([min(nums), max(nums)] + [0, 0])[:2] if nums else [30, 180]
|
|
|
+ _bury(cfg, path, pair)
|
|
|
else:
|
|
|
_bury(cfg, path, raw)
|
|
|
|