Fix thumbnail migrator use of pathclass.

This commit is contained in:
voussoir 2022-08-13 17:48:26 -07:00
parent cfe724b384
commit d819b23263
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -818,7 +818,7 @@ def upgrade_20_to_21(photodb):
old_thumbnail = photo.thumbnail old_thumbnail = photo.thumbnail
new_thumbnail = photo.make_thumbnail_filepath() new_thumbnail = photo.make_thumbnail_filepath()
print(old_thumbnail, new_thumbnail) print(old_thumbnail, new_thumbnail)
photodb.on_commit_queue.append({'action': movethumbnail, 'args': (old_thumbnail.absolute_path, new_thumbnail.absolute_path)}) photodb.on_commit_queue.append({'action': movethumbnail, 'args': (old_thumbnail, new_thumbnail)})
store_as = new_thumbnail.relative_to(photodb.thumbnail_directory) store_as = new_thumbnail.relative_to(photodb.thumbnail_directory)
photodb.update(table=etiquette.objects.Photo, pairs={'id': photo.id, 'thumbnail': store_as}, where_key='id') photodb.update(table=etiquette.objects.Photo, pairs={'id': photo.id, 'thumbnail': store_as}, where_key='id')
photo.thumbnail = new_thumbnail photo.thumbnail = new_thumbnail