From d4e3ba407fc9ca8835d055d36888925feceb3f72 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 11 Feb 2016 11:45:17 +0530 Subject: [PATCH] pass commit to add_file --- oml/item/scan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oml/item/scan.py b/oml/item/scan.py index 90d9c4e..ec6ccf4 100644 --- a/oml/item/scan.py +++ b/oml/item/scan.py @@ -50,7 +50,7 @@ def remove_missing(): f.move() remove_empty_folders(prefix, True) -def add_file(id, f, prefix, from_=None): +def add_file(id, f, prefix, from_=None, commit=True): user = state.user() path = f[len(prefix):] logger.debug('%s extract metadata %s', id, path) @@ -68,7 +68,7 @@ def add_file(id, f, prefix, from_=None): item.update_icons() item.modified = datetime.utcnow() logger.debug('%s save item', id) - item.update() + item.update(commit=commit) logger.debug('%s added', id) return file