feat: add scan library functionality and related error handling in LibraryHeader and services

This commit is contained in:
Julien Froidefond
2025-10-19 09:55:07 +02:00
parent 3704a8d88b
commit 7d9bac5c51
9 changed files with 195 additions and 9 deletions

View File

@@ -159,4 +159,15 @@ export class LibraryService extends BaseApiService {
throw new AppError(ERROR_CODES.CACHE.DELETE_ERROR, {}, error);
}
}
static async scanLibrary(libraryId: string, deep: boolean = false): Promise<void> {
try {
await this.fetchFromApi({
path: `libraries/${libraryId}/scan`,
params: { deep: String(deep) }
}, {}, { method: "POST", noJson: true });
} catch (error) {
throw new AppError(ERROR_CODES.LIBRARY.SCAN_ERROR, { libraryId }, error);
}
}
}