Let relocate photo accept the old filepath in place of photo id.

This commit is contained in:
voussoir 2022-11-06 22:58:56 -08:00
parent b64901105c
commit ba99b43bc7

View file

@ -497,6 +497,9 @@ def relocate_argparse(args):
load_photodb() load_photodb()
with photodb.transaction: with photodb.transaction:
if '.' in args.photo_id:
photo = photodb.get_photo_by_path(args.photo_id)
else:
photo = photodb.get_photo(args.photo_id) photo = photodb.get_photo(args.photo_id)
photo.relocate(args.filepath) photo.relocate(args.filepath)
@ -1310,6 +1313,9 @@ def main(argv):
) )
p_relocate.add_argument( p_relocate.add_argument(
'filepath', 'filepath',
help='''
The new filepath of the photo.
''',
) )
p_relocate.add_argument( p_relocate.add_argument(
'--yes', '--yes',