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.master
parent
49fa9263b6
commit
c5b3c65ea1
|
@ -667,7 +667,10 @@ def upgrade_19_to_20(photodb):
|
||||||
raise Exception(f'{new.absolute_path} already has items in it.')
|
raise Exception(f'{new.absolute_path} already has items in it.')
|
||||||
else:
|
else:
|
||||||
os.rmdir(new.absolute_path)
|
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):
|
def upgrade_all(data_directory):
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in New Issue