0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-21 00:52:43 -05:00

fix(server): skip originals when deleting a library (#9496)

This commit is contained in:
Jason Rasmussen 2024-05-14 17:29:57 -04:00 committed by GitHub
parent d62e90424e
commit ce7bbe88f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
} }