censored might not be set

This commit is contained in:
j 2026-01-16 10:09:11 +00:00
commit 4503e26d80

View file

@ -953,7 +953,7 @@ def generate_clips(options):
options = load_defaults(options)
prefix = options['prefix']
lang, tlang = parse_lang(options["lang"])
if options['censored']:
if options.get('censored'):
censored_list = itemlist.models.List.get(options["censored"])
censored = list(censored_list.get_items(
censored_list.user
@ -981,7 +981,7 @@ def generate_clips(options):
os.symlink(source, target)
if type_ == "original":
original_target = target
if options['censored'] and e.public_id in censored:
if options.get('censored') and e.public_id in censored:
clip[type_ + "_censored"] = target
target = '/srv/t_for_time/censored.mp4'
clip[type_] = target
@ -1050,7 +1050,7 @@ def generate_clips(options):
with open(os.path.join(prefix, 'voice_over.json'), 'w') as fd:
json.dump(voice_over, fd, indent=2, ensure_ascii=False)
if options['censored']:
if options.get('censored'):
censored_mp4 = '/srv/t_for_time/censored.mp4'
if not os.path.exists(censored_mp4):
cmd = [