Use get_photos_from_args in export to reduce dupe code.
This commit is contained in:
		
							parent
							
								
									60ac8116aa
								
							
						
					
					
						commit
						1511852e94
					
				
					 1 changed files with 16 additions and 22 deletions
				
			
		|  | @ -235,11 +235,8 @@ def export_symlinks_argparse(args): | ||||||
| 
 | 
 | ||||||
|     total_paths = set() |     total_paths = set() | ||||||
| 
 | 
 | ||||||
|     albums = [] |     if args.album_id_args or args.album_search_args: | ||||||
|     if args.album_id_args: |         albums = get_albums_from_args(args) | ||||||
|         albums.extend(photodb.get_albums_by_id(args.album_id_args)) |  | ||||||
|     if args.album_search_args: |  | ||||||
|         albums.extend(search_by_argparse(args.album_search_args, yield_albums=True)) |  | ||||||
|         export = export_symlinks_albums( |         export = export_symlinks_albums( | ||||||
|             albums, |             albums, | ||||||
|             destination, |             destination, | ||||||
|  | @ -247,11 +244,8 @@ def export_symlinks_argparse(args): | ||||||
|         ) |         ) | ||||||
|         total_paths.update(export) |         total_paths.update(export) | ||||||
| 
 | 
 | ||||||
|     photos = [] |     if args.photo_id_args or args.photo_search_args: | ||||||
|     if args.photo_id_args: |         photos = get_photos_from_args(args) | ||||||
|         photos.extend(photodb.get_photos_by_id(args.photo_id_args)) |  | ||||||
|     if args.photo_search_args: |  | ||||||
|         photos.extend(search_by_argparse(args.photo_search_args, yield_photos=True)) |  | ||||||
|         export = export_symlinks_photos( |         export = export_symlinks_photos( | ||||||
|             photos, |             photos, | ||||||
|             destination, |             destination, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue