set defaults
This commit is contained in:
parent
38a893aae7
commit
e31df1790c
1 changed files with 10 additions and 5 deletions
15
render.py
15
render.py
|
|
@ -885,19 +885,24 @@ def render_infinity(options):
|
|||
prefix = options['prefix']
|
||||
duration = int(options['duration'])
|
||||
|
||||
defaults = {
|
||||
"offset": 100,
|
||||
"max-items": 30,
|
||||
"no_video": False,
|
||||
}
|
||||
state_f = os.path.join(prefix, "infinity.json")
|
||||
if os.path.exists(state_f):
|
||||
with open(state_f) as fd:
|
||||
state = json.load(fd)
|
||||
else:
|
||||
state = {
|
||||
"offset": 100,
|
||||
"max-items": 30,
|
||||
"no_video": False,
|
||||
}
|
||||
state = {}
|
||||
for key in ("prefix", "duration", "debug", "single_file", "keep_audio", "stereo_downmix"):
|
||||
state[key] = options[key]
|
||||
|
||||
for key in defaults:
|
||||
if key not in state:
|
||||
state[key] = defaults[key]
|
||||
|
||||
while True:
|
||||
render_prefix = state["prefix"] + "/render/"
|
||||
current = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue