Let set_searchhidden take no params, and simplify duplicate checks.
This commit is contained in:
		
							parent
							
								
									e80f27e1fd
								
							
						
					
					
						commit
						5792c3bdcf
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -92,7 +92,7 @@ def add_tag_argparse(args): | ||||||
|     photodb = find_photodb() |     photodb = find_photodb() | ||||||
| 
 | 
 | ||||||
|     tag = photodb.get_tag(name=args.tag_name) |     tag = photodb.get_tag(name=args.tag_name) | ||||||
|     if args.photo_id_args or args.photo_search_args: |     if args.any_id_args: | ||||||
|         photos = get_photos_from_args(args) |         photos = get_photos_from_args(args) | ||||||
|     else: |     else: | ||||||
|         photos = search_in_cwd(yield_photos=True, yield_albums=False) |         photos = search_in_cwd(yield_photos=True, yield_albums=False) | ||||||
|  | @ -162,9 +162,12 @@ def set_unset_searchhidden_argparse(args, searchhidden): | ||||||
|     if args.album_search_args: |     if args.album_search_args: | ||||||
|         args.album_search_args.is_searchhidden = not searchhidden |         args.album_search_args.is_searchhidden = not searchhidden | ||||||
| 
 | 
 | ||||||
|  |     if args.any_id_args: | ||||||
|         photos = get_photos_from_args(args) |         photos = get_photos_from_args(args) | ||||||
|         albums = get_albums_from_args(args) |         albums = get_albums_from_args(args) | ||||||
|         photos.extend(photo for album in albums for photo in album.walk_photos()) |         photos.extend(photo for album in albums for photo in album.walk_photos()) | ||||||
|  |     else: | ||||||
|  |         photos = search_in_cwd(yield_photos=True, yield_albums=False) | ||||||
| 
 | 
 | ||||||
|     for photo in photos: |     for photo in photos: | ||||||
|         print(photo) |         print(photo) | ||||||
|  | @ -320,6 +323,7 @@ def main(argv): | ||||||
|     args.album_search_args = album_search_args |     args.album_search_args = album_search_args | ||||||
|     args.photo_id_args = photo_id_args |     args.photo_id_args = photo_id_args | ||||||
|     args.album_id_args = album_id_args |     args.album_id_args = album_id_args | ||||||
|  |     args.any_id_args = bool(photo_search_args or album_search_args or photo_id_args or album_id_args) | ||||||
| 
 | 
 | ||||||
|     return args.func(args) |     return args.func(args) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue