From e1b27412536b6e5128292dee77bd7abea5420829 Mon Sep 17 00:00:00 2001 From: xenofem Date: Mon, 22 Jan 2024 07:36:23 -0500 Subject: [PATCH] let manual-collate automatically deduce the work id from the paths --- dlibrary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlibrary.py b/dlibrary.py index 0e57883..8626cb3 100755 --- a/dlibrary.py +++ b/dlibrary.py @@ -202,7 +202,9 @@ def collate(args): con.close() def manual_collate(args): - collation_dir = args.destdir / 'site' / 'images' / args.work_id + work_id = args.paths[0].relative_to(args.destdir / 'extract').parents[-2].name + + collation_dir = args.destdir / 'site' / 'images' / work_id if collation_dir.exists() and len(list(collation_dir.iterdir())) > 0: print(f'Collation directory already exists!') return @@ -346,7 +348,6 @@ parser_collate.add_argument( parser_collate.set_defaults(func=collate) parser_manual_collate = subparsers.add_parser('manual-collate', help='collate a specific work manually, specifying all paths to include') -parser_manual_collate.add_argument('work_id') parser_manual_collate.add_argument( 'paths', metavar='PATH',