Always use the commit queue, don't bypass with commit=True.
This commit is contained in:
parent
7f3602d673
commit
00a443eec3
1 changed files with 4 additions and 11 deletions
|
@ -735,11 +735,8 @@ class Photo(ObjectBase):
|
||||||
|
|
||||||
if delete_file:
|
if delete_file:
|
||||||
path = self.real_path.absolute_path
|
path = self.real_path.absolute_path
|
||||||
if commit:
|
queue_action = {'action': os.remove, 'args': [path]}
|
||||||
os.remove(path)
|
self.photodb.on_commit_queue.append(queue_action)
|
||||||
else:
|
|
||||||
queue_action = {'action': os.remove, 'args': [path]}
|
|
||||||
self.photodb.on_commit_queue.append(queue_action)
|
|
||||||
self._uncache()
|
self._uncache()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1039,12 +1036,8 @@ class Photo(ObjectBase):
|
||||||
args = [old_path.absolute_path]
|
args = [old_path.absolute_path]
|
||||||
|
|
||||||
self._uncache()
|
self._uncache()
|
||||||
if commit:
|
queue_action = {'action': action, 'args': args}
|
||||||
action(*args)
|
self.photodb.on_commit_queue.append(queue_action)
|
||||||
self.photodb.commit(message='rename file')
|
|
||||||
else:
|
|
||||||
queue_action = {'action': action, 'args': args}
|
|
||||||
self.photodb.on_commit_queue.append(queue_action)
|
|
||||||
|
|
||||||
self.__reinit__()
|
self.__reinit__()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue