fix subtitle import

This commit is contained in:
j 2024-04-30 16:44:35 +01:00
parent 4f57230996
commit 793da444ad

View file

@ -31,7 +31,7 @@ class Command(BaseCommand):
with open(filename) as fd: with open(filename) as fd:
data = fd.read() data = fd.read()
data = data.strip().split('\n## ')[1:] data = ('\n' + data.strip()).split('\n## ')[1:]
invalid = [] invalid = []
valid = [] valid = []
@ -46,6 +46,9 @@ class Command(BaseCommand):
lines = block.split('\n\n') lines = block.split('\n\n')
if len(lines) != subtitles_en.count(): if len(lines) != subtitles_en.count():
print('%s: number of subtitles does not match, en: %s vs %s: %s' % (title, subtitles_en.count(), lang, len(lines))) print('%s: number of subtitles does not match, en: %s vs %s: %s' % (title, subtitles_en.count(), lang, len(lines)))
if options["test"]:
print(json.dumps(lines, indent=2, ensure_ascii=False))
print(json.dumps([s.value for s in subtitles_en.order_by('start')], indent=2, ensure_ascii=False))
continue continue
if options["test"]: if options["test"]: