diff --git a/management/commands/import_subtitles.py b/management/commands/import_subtitles.py index c812325..6dcfe4a 100644 --- a/management/commands/import_subtitles.py +++ b/management/commands/import_subtitles.py @@ -31,7 +31,7 @@ class Command(BaseCommand): with open(filename) as fd: data = fd.read() - data = data.strip().split('\n## ')[1:] + data = ('\n' + data.strip()).split('\n## ')[1:] invalid = [] valid = [] @@ -46,6 +46,9 @@ class Command(BaseCommand): lines = block.split('\n\n') 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))) + 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 if options["test"]: