forked from 0x2620/pandora
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='')
|
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):
|
||||||
|
|
Loading…
Reference in a new issue