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