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:
parent
d62e90424e
commit
ce7bbe88f9
1 changed files with 7 additions and 6 deletions
|
@ -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…
Add table
Reference in a new issue