From dcb0a16153906aa951492b122b0c77b90201bc19 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 1 Dec 2015 12:09:50 +0100 Subject: [PATCH] only scrape with item, move after editing metadata --- oml/item/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oml/item/models.py b/oml/item/models.py index 952fc32..c08fdf5 100644 --- a/oml/item/models.py +++ b/oml/item/models.py @@ -298,6 +298,8 @@ class Item(db.Model): m.update_items() else: self.update_meta(data) + for f in self.files.all(): + f.move() def extract_preview(self): path = self.get_path() @@ -695,7 +697,8 @@ class Metadata(db.Model): def update_items(self): for f in Find.query.filter_by(key=self.key, value=self.value): - f.item.scrape() + if f.item: + f.item.scrape() @classmethod def load(self, key, value):