mirror of
https://github.com/immich-app/immich.git
synced 2025-06-04 22:24:26 -04:00
fix: library deletion (#13350)
This commit is contained in:
parent
24e266cd52
commit
97edf90889
@ -341,7 +341,10 @@ export class LibraryService extends BaseService {
|
|||||||
|
|
||||||
this.logger.debug(`Will delete all assets in library ${libraryId}`);
|
this.logger.debug(`Will delete all assets in library ${libraryId}`);
|
||||||
for await (const assets of assetPagination) {
|
for await (const assets of assetPagination) {
|
||||||
|
if (assets.length > 0) {
|
||||||
assetsFound = true;
|
assetsFound = true;
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.debug(`Queueing deletion of ${assets.length} asset(s) in library ${libraryId}`);
|
this.logger.debug(`Queueing deletion of ${assets.length} asset(s) in library ${libraryId}`);
|
||||||
await this.jobRepository.queueAll(
|
await this.jobRepository.queueAll(
|
||||||
assets.map((asset) => ({
|
assets.map((asset) => ({
|
||||||
@ -545,7 +548,10 @@ export class LibraryService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validImportPaths) {
|
if (validImportPaths.length === 0) {
|
||||||
|
this.logger.warn(`No valid import paths found for library ${library.id}`);
|
||||||
|
}
|
||||||
|
|
||||||
const assetsOnDisk = this.storageRepository.walk({
|
const assetsOnDisk = this.storageRepository.walk({
|
||||||
pathsToCrawl: validImportPaths,
|
pathsToCrawl: validImportPaths,
|
||||||
includeHidden: false,
|
includeHidden: false,
|
||||||
@ -564,12 +570,9 @@ export class LibraryService extends BaseService {
|
|||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
this.logger.debug(`Finished queueing scan of ${count} assets on disk for library ${library.id}`);
|
this.logger.debug(`Finished queueing scan of ${count} assets on disk for library ${library.id}`);
|
||||||
} else {
|
} else if (validImportPaths.length > 0) {
|
||||||
this.logger.debug(`No non-excluded assets found in any import path for library ${library.id}`);
|
this.logger.debug(`No non-excluded assets found in any import path for library ${library.id}`);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.logger.warn(`No valid import paths found for library ${library.id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.libraryRepository.update({ id: job.id, refreshedAt: new Date() });
|
await this.libraryRepository.update({ id: job.id, refreshedAt: new Date() });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user