pass commit to add_file

This commit is contained in:
j 2016-02-11 11:45:17 +05:30
parent acd64d3186
commit d4e3ba407f

View file

@ -50,7 +50,7 @@ def remove_missing():
f.move() f.move()
remove_empty_folders(prefix, True) 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() user = state.user()
path = f[len(prefix):] path = f[len(prefix):]
logger.debug('%s extract metadata %s', id, path) logger.debug('%s extract metadata %s', id, path)
@ -68,7 +68,7 @@ def add_file(id, f, prefix, from_=None):
item.update_icons() item.update_icons()
item.modified = datetime.utcnow() item.modified = datetime.utcnow()
logger.debug('%s save item', id) logger.debug('%s save item', id)
item.update() item.update(commit=commit)
logger.debug('%s added', id) logger.debug('%s added', id)
return file return file