This commit is contained in:
j 2015-09-24 18:35:13 +01:00
parent 79dbeabafc
commit 1e81dc4fa1

View file

@ -1540,9 +1540,7 @@ class Item(models.Model):
existing = self.annotations.filter(layer=layer).exclude(value='') existing = self.annotations.filter(layer=layer).exclude(value='')
# only import on 0xdb for now or if forced manually # only import on 0xdb for now or if forced manually
# since this will remove all existing subtitles # since this will remove all existing subtitles
if not (settings.USE_IMDB or existing.count() == 0) or not force: if force or not existing.count() or settings.USE_IMDB:
self.add_empty_clips()
return False
with transaction.commit_on_success(): with transaction.commit_on_success():
Annotation.objects.filter(layer=layer, item=self).delete() Annotation.objects.filter(layer=layer, item=self).delete()
AnnotationSequence.reset(self) AnnotationSequence.reset(self)
@ -1607,6 +1605,9 @@ class Item(models.Model):
#remove left over clips without annotations #remove left over clips without annotations
Clip.objects.filter(item=self, annotations__id=None).delete() Clip.objects.filter(item=self, annotations__id=None).delete()
return True return True
else:
self.add_empty_clips()
return False
def srt(self, layer, language=None): def srt(self, layer, language=None):
def format_value(value): def format_value(value):