Fix hasty and irresponsible leftover site_thumbnails in db.
There was a brief period where the thumbnail filepaths were stored in full, now they are stored relative to the thumb directory. But those leftover full paths need to be altered.
This commit is contained in:
parent
49fa9263b6
commit
c5b3c65ea1
1 changed files with 4 additions and 1 deletions
|
@ -667,7 +667,10 @@ def upgrade_19_to_20(photodb):
|
|||
raise Exception(f'{new.absolute_path} already has items in it.')
|
||||
else:
|
||||
os.rmdir(new.absolute_path)
|
||||
os.rename(old.absolute_path, new.absolute_path)
|
||||
|
||||
photodb.execute('UPDATE photos SET thumbnail = REPLACE(thumbnail, "/site_thumbnails/", "/thumbnails/")')
|
||||
photodb.execute('UPDATE photos SET thumbnail = REPLACE(thumbnail, "\\site_thumbnails\\", "\\thumbnails\\")')
|
||||
photodb.on_commit_queue.append({'action': os.rename, 'args': (old.absolute_path, new.absolute_path)})
|
||||
|
||||
def upgrade_all(data_directory):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue