handle only english title items

This commit is contained in:
j 2021-10-29 08:26:36 +01:00
parent 410ad67c38
commit 3035dc3ccf

View file

@ -28,7 +28,11 @@ class Command(BaseCommand):
f, c = models.Film.objects.get_or_create(padma_id=item['id']) f, c = models.Film.objects.get_or_create(padma_id=item['id'])
for key, value in item.items(): for key, value in item.items():
if key == 'title': if key == 'title':
if ' / ' in value:
f.data['title'], f.data['title_zh'] = value.split(' / ', 1) f.data['title'], f.data['title_zh'] = value.split(' / ', 1)
else:
f.data['title'] = value
f.data['title_zh'] = ''
elif key == 'summary': elif key == 'summary':
f.data['summary'], f.data['summary_zh'] = value.split('<br><br>', 1) f.data['summary'], f.data['summary_zh'] = value.split('<br><br>', 1)
elif key == 'sourcedescription': elif key == 'sourcedescription':