mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	fix(server): skip originals when deleting a library (#9496)
This commit is contained in:
		
							parent
							
								
									d62e90424e
								
							
						
					
					
						commit
						ce7bbe88f9
					
				@ -434,12 +434,13 @@ export class AssetService {
 | 
				
			|||||||
      await this.jobRepository.queue({ name: JobName.ASSET_DELETION, data: { id: asset.livePhotoVideoId } });
 | 
					      await this.jobRepository.queue({ name: JobName.ASSET_DELETION, data: { id: asset.livePhotoVideoId } });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await this.jobRepository.queue({
 | 
					    const files = [asset.thumbnailPath, asset.previewPath, asset.encodedVideoPath];
 | 
				
			||||||
      name: JobName.DELETE_FILES,
 | 
					    // skip originals if the user deleted the whole library
 | 
				
			||||||
      data: {
 | 
					    if (!asset.library.deletedAt) {
 | 
				
			||||||
        files: [asset.thumbnailPath, asset.previewPath, asset.encodedVideoPath, asset.sidecarPath, asset.originalPath],
 | 
					      files.push(asset.sidecarPath, asset.originalPath);
 | 
				
			||||||
      },
 | 
					    }
 | 
				
			||||||
    });
 | 
					
 | 
				
			||||||
 | 
					    await this.jobRepository.queue({ name: JobName.DELETE_FILES, data: { files } });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return JobStatus.SUCCESS;
 | 
					    return JobStatus.SUCCESS;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user