Update self.real_path after relocating and renaming.

This commit is contained in:
voussoir 2020-09-17 20:38:17 -07:00
parent 39b7f3cd98
commit a093dc273c

View file

@ -1033,7 +1033,7 @@ class Photo(ObjectBase):
'filepath': new_filepath.absolute_path, 'filepath': new_filepath.absolute_path,
} }
self.photodb.sql_update(table='photos', pairs=data, where_key='id') self.photodb.sql_update(table='photos', pairs=data, where_key='id')
self.real_path = new_filepath
self._uncache() self._uncache()
@decorators.required_feature('photo.add_remove_tag') @decorators.required_feature('photo.add_remove_tag')
@ -1118,6 +1118,7 @@ class Photo(ObjectBase):
'filepath': (old_path.absolute_path, new_path.absolute_path), 'filepath': (old_path.absolute_path, new_path.absolute_path),
} }
self.photodb.sql_update(table='photos', pairs=data, where_key='filepath') self.photodb.sql_update(table='photos', pairs=data, where_key='filepath')
self.real_path = new_path
if new_path.normcase == old_path.normcase: if new_path.normcase == old_path.normcase:
# If they are equivalent but differently cased, just rename. # If they are equivalent but differently cased, just rename.