clip sort

This commit is contained in:
j 2019-06-28 17:26:28 +02:00
parent f0217ef9eb
commit 8327ef9cff

View file

@ -478,7 +478,11 @@ class Item(models.Model):
a.item = other a.item = other
a.set_public_id() a.set_public_id()
Annotation.objects.filter(id=a.id).update(item=other, public_id=a.public_id) Annotation.objects.filter(id=a.id).update(item=other, public_id=a.public_id)
self.clips.all().update(item=other, sort=other.sort) try:
other_sort = other.sort
except:
other_sort = None
self.clips.all().update(item=other, sort=other_sort)
if hasattr(self, 'files'): if hasattr(self, 'files'):
for f in self.files.all(): for f in self.files.all():
@ -488,6 +492,8 @@ class Item(models.Model):
if save: if save:
other.save() other.save()
# FIXME: update poster, stills and streams after this # FIXME: update poster, stills and streams after this
if other_sort is None:
other.clips.all().update(sort=other.sort)
def merge_streams(self, output, resolution=None, format="webm"): def merge_streams(self, output, resolution=None, format="webm"):
streams = [s.get(resolution, format).media.path for s in self.streams()] streams = [s.get(resolution, format).media.path for s in self.streams()]