switch
This commit is contained in:
parent
79dbeabafc
commit
1e81dc4fa1
1 changed files with 61 additions and 60 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue