[config] support accumulating non-list values

fixes 1264fc518b
This commit is contained in:
Mike Fährmann
2024-11-16 21:13:57 +01:00
parent bced143750
commit 80454460ce
3 changed files with 26 additions and 4 deletions

View File

@@ -261,13 +261,19 @@ def accumulate(path, key, conf=_config):
if key in conf:
value = conf[key]
if value:
result.extend(value)
if isinstance(value, list):
result.extend(value)
else:
result.append(value)
for p in path:
conf = conf[p]
if key in conf:
value = conf[key]
if value:
result[:0] = value
if isinstance(value, list):
result[:0] = value
else:
result.insert(0, value)
except Exception:
pass
return result

View File

@@ -619,8 +619,6 @@ class DownloadJob(Job):
pp_opts = cfg("postprocessor-options")
pp_list = []
if isinstance(postprocessors, (dict, str)):
postprocessors = (postprocessors,)
for pp_dict in postprocessors:
if isinstance(pp_dict, str):
pp_dict = pp_conf.get(pp_dict) or {"name": pp_dict}