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.DELETE_FILES,
 | 
			
		||||
      data: {
 | 
			
		||||
        files: [asset.thumbnailPath, asset.previewPath, asset.encodedVideoPath, asset.sidecarPath, asset.originalPath],
 | 
			
		||||
      },
 | 
			
		||||
    });
 | 
			
		||||
    const files = [asset.thumbnailPath, asset.previewPath, asset.encodedVideoPath];
 | 
			
		||||
    // skip originals if the user deleted the whole library
 | 
			
		||||
    if (!asset.library.deletedAt) {
 | 
			
		||||
      files.push(asset.sidecarPath, asset.originalPath);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await this.jobRepository.queue({ name: JobName.DELETE_FILES, data: { files } });
 | 
			
		||||
 | 
			
		||||
    return JobStatus.SUCCESS;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user