handle edge-case where we need to manual-collate the top-level directory of an extracted work
This commit is contained in:
		
							parent
							
								
									01f5955844
								
							
						
					
					
						commit
						578a46c217
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -210,8 +210,11 @@ def collate(args): | |||
| 
 | ||||
|     con.close() | ||||
| 
 | ||||
| def self_and_parents(path): | ||||
|     return [path] + list(path.parents) | ||||
| 
 | ||||
| def manual_collate(args): | ||||
|     work_id = args.paths[0].relative_to(args.destdir / 'extract').parents[-2].name | ||||
|     work_id = self_and_parents(args.paths[0].relative_to(args.destdir / 'extract'))[-2].name | ||||
| 
 | ||||
|     collation_dir = args.destdir / 'site' / 'images' / work_id | ||||
|     if collation_dir.exists() and len(list(collation_dir.iterdir())) > 0: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue