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()
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.relocate(args.filepath)
@ -1310,6 +1313,9 @@ def main(argv):
)
p_relocate.add_argument(
'filepath',
help='''
The new filepath of the photo.
''',
)
p_relocate.add_argument(
'--yes',