From ba99b43bc7c7379a4599ea9d950aabcf3d426445 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 6 Nov 2022 22:58:56 -0800 Subject: [PATCH] Let relocate photo accept the old filepath in place of photo id. --- frontends/etiquette_cli.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontends/etiquette_cli.py b/frontends/etiquette_cli.py index c2f2e73..d023f3d 100644 --- a/frontends/etiquette_cli.py +++ b/frontends/etiquette_cli.py @@ -497,7 +497,10 @@ def relocate_argparse(args): load_photodb() with photodb.transaction: - photo = photodb.get_photo(args.photo_id) + 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) if not (args.autoyes or interactive.getpermission('Commit?')): @@ -1310,6 +1313,9 @@ def main(argv): ) p_relocate.add_argument( 'filepath', + help=''' + The new filepath of the photo. + ''', ) p_relocate.add_argument( '--yes',