From 8327ef9cff68226e85f2f7cce9d60c5d1d4e3af5 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 28 Jun 2019 17:26:28 +0200 Subject: [PATCH] clip sort --- pandora/item/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 847436de5..6bb4f50ae 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -478,7 +478,11 @@ class Item(models.Model): a.item = other a.set_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'): for f in self.files.all(): @@ -488,6 +492,8 @@ class Item(models.Model): if save: other.save() # 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"): streams = [s.get(resolution, format).media.path for s in self.streams()]