fix default options
This commit is contained in:
parent
3f9280e0ba
commit
4e767b7268
1 changed files with 9 additions and 4 deletions
13
render.py
13
render.py
|
|
@ -377,6 +377,9 @@ def write_subtitles(data, folder, options):
|
|||
if options.get("subtitle_format") == "srt":
|
||||
srt = ox.srt.encode(data)
|
||||
write_if_new(str(path), srt, 'b')
|
||||
path = folder / "front.ass"
|
||||
if os.path.exists(path):
|
||||
os.unlink(path)
|
||||
else:
|
||||
if os.path.exists(path):
|
||||
os.unlink(path)
|
||||
|
|
@ -386,7 +389,8 @@ def write_subtitles(data, folder, options):
|
|||
|
||||
|
||||
def render(root, scene, prefix='', options=None):
|
||||
if options is None: options = {}
|
||||
if options is None:
|
||||
options = {}
|
||||
fps = 24
|
||||
files = []
|
||||
scene_duration = int(get_scene_duration(scene) * fps)
|
||||
|
|
@ -903,7 +907,7 @@ def load_defaults(options):
|
|||
path = os.path.join(options["prefix"], "options.json")
|
||||
if os.path.exists(path):
|
||||
with open(path) as fd:
|
||||
defaults = json.loads(fd)
|
||||
defaults = json.load(fd)
|
||||
for key in defaults:
|
||||
if key not in options:
|
||||
options[key] = defaults[key]
|
||||
|
|
@ -939,8 +943,8 @@ def ass_encode(subs, options):
|
|||
langs = options["lang"].split(',')
|
||||
else:
|
||||
langs = list(subs[0]["values"])
|
||||
print('ass_encode', langs, options)
|
||||
print(subs)
|
||||
#print('ass_encode', langs, options)
|
||||
#print(subs)
|
||||
|
||||
header = '''[Script Info]
|
||||
ScriptType: v4.00+
|
||||
|
|
@ -1092,6 +1096,7 @@ def generate_clips(options):
|
|||
import item.models
|
||||
import itemlist.models
|
||||
|
||||
options = load_defaults(options)
|
||||
prefix = options['prefix']
|
||||
lang, tlang = parse_lang(options["lang"])
|
||||
if options['censored']:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue