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