Background Prefetching for Kavita+ (#2707)

This commit is contained in:
Joe Milazzo 2024-02-10 09:43:17 -06:00 committed by GitHub
parent f616b99585
commit 5dc5029a75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 3300 additions and 100 deletions

View file

@ -552,11 +552,9 @@ export class ActionService implements OnDestroy {
}
/**
* Mark all chapters and the volumes as Read. All volumes and chapters must belong to a series
* @param seriesId Series Id
* @param volumes Volumes, should have id, chapters and pagesRead populated
* @param chapters? Chapters, should have id
* @param callback Optional callback to perform actions after API completes
* Deletes all series
* @param seriesIds - List of series
* @param callback - Optional callback once complete
*/
async deleteMultipleSeries(seriesIds: Array<Series>, callback?: BooleanActionCallback) {
if (!await this.confirmService.confirm(translate('toasts.confirm-delete-multiple-series', {count: seriesIds.length}))) {
@ -565,11 +563,15 @@ export class ActionService implements OnDestroy {
}
return;
}
this.seriesService.deleteMultipleSeries(seriesIds.map(s => s.id)).pipe(take(1)).subscribe(() => {
this.toastr.success(translate('toasts.series-deleted'));
this.seriesService.deleteMultipleSeries(seriesIds.map(s => s.id)).pipe(take(1)).subscribe(res => {
if (res) {
this.toastr.success(translate('toasts.series-deleted'));
} else {
this.toastr.error(translate('errors.generic'));
}
if (callback) {
callback(true);
callback(res);
}
});
}
@ -584,7 +586,12 @@ export class ActionService implements OnDestroy {
this.seriesService.delete(series.id).subscribe((res: boolean) => {
if (callback) {
this.toastr.success(translate('toasts.series-deleted'));
if (res) {
this.toastr.success(translate('toasts.series-deleted'));
} else {
this.toastr.error(translate('errors.generic'));
}
callback(res);
}
});