mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
fix library deletion actually deleting assets (#4386)
This commit is contained in:
parent
982dcd7b8d
commit
66ccf298ba
@ -137,14 +137,16 @@ export class LibraryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO use pagination
|
// TODO use pagination
|
||||||
const assetIds = await this.repository.getAssetIds(job.id);
|
const assetIds = await this.repository.getAssetIds(job.id, true);
|
||||||
this.logger.debug(`Will delete ${assetIds.length} asset(s) in library ${job.id}`);
|
this.logger.debug(`Will delete ${assetIds.length} asset(s) in library ${job.id}`);
|
||||||
for (const assetId of assetIds) {
|
for (const assetId of assetIds) {
|
||||||
await this.jobRepository.queue({ name: JobName.ASSET_DELETION, data: { id: assetId, fromExternal: true } });
|
await this.jobRepository.queue({ name: JobName.ASSET_DELETION, data: { id: assetId, fromExternal: true } });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.log(`Deleting library ${job.id}`);
|
if (assetIds.length === 0) {
|
||||||
await this.repository.delete(job.id);
|
this.logger.log(`Deleting library ${job.id}`);
|
||||||
|
await this.repository.delete(job.id);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user