From d3e38fceece8fbaabcd687d1710dda6e8bfda1d2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 31 May 2013 15:26:44 +0000 Subject: [PATCH] make sure file is in item files while updating item, fixes #1552 --- pandora/archive/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index efc006f0..84c2151b 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -179,7 +179,7 @@ class File(models.Model): files = [] volume = self.instances.all()[0].volume - for f in self.item.files.filter(instances__volume=volume): + def add_file(f): instance = f.instances.all()[0] files.append(f.get_path_info()) files[-1].update({ @@ -189,6 +189,9 @@ class File(models.Model): 'oshash': f.oshash, 'size': f.size }) + add_file(self) + for f in self.item.files.filter(instances__volume=volume).exclude(id=self.id): + add_file(f) versions = ox.movie.parse_item_files(files) for version in versions: p = filter(lambda f: f['oshash'] == self.oshash, version['files'])