set defaults

This commit is contained in:
j 2025-10-08 11:35:10 +01:00
commit e31df1790c

View file

@ -885,19 +885,24 @@ def render_infinity(options):
prefix = options['prefix'] prefix = options['prefix']
duration = int(options['duration']) duration = int(options['duration'])
defaults = {
"offset": 100,
"max-items": 30,
"no_video": False,
}
state_f = os.path.join(prefix, "infinity.json") state_f = os.path.join(prefix, "infinity.json")
if os.path.exists(state_f): if os.path.exists(state_f):
with open(state_f) as fd: with open(state_f) as fd:
state = json.load(fd) state = json.load(fd)
else: else:
state = { state = {}
"offset": 100,
"max-items": 30,
"no_video": False,
}
for key in ("prefix", "duration", "debug", "single_file", "keep_audio", "stereo_downmix"): for key in ("prefix", "duration", "debug", "single_file", "keep_audio", "stereo_downmix"):
state[key] = options[key] state[key] = options[key]
for key in defaults:
if key not in state:
state[key] = defaults[key]
while True: while True:
render_prefix = state["prefix"] + "/render/" render_prefix = state["prefix"] + "/render/"
current = [ current = [