Unify TasksV1 and TasksV2 implementations (#1358)

This commit is contained in:
Aditya Chandel
2025-10-15 19:59:30 -06:00
committed by GitHub
parent 675bed1a65
commit d90cb73148
27 changed files with 176 additions and 1070 deletions
@@ -481,41 +481,6 @@ export class BookService {
);
}
getComicInfoMetadata(bookId: number): Observable<BookMetadata> {
return this.http.get<BookMetadata>(`${this.url}/${bookId}/cbx/metadata/comicinfo`);
}
autoRefreshMetadata(metadataRefreshRequest: MetadataRefreshRequest): Observable<any> {
return this.http.put<void>(`${this.url}/metadata/refresh`, metadataRefreshRequest).pipe(
map(() => {
this.messageService.add({
severity: 'success',
summary: 'Metadata Update Scheduled',
detail: 'The metadata update for the selected books has been successfully scheduled.'
});
return {success: true};
}),
catchError((e) => {
if (e.status === 409) {
this.messageService.add({
severity: 'error',
summary: 'Task Already Running',
life: 5000,
detail: 'A metadata refresh task is already in progress. Please wait for it to complete before starting another one.'
});
} else {
this.messageService.add({
severity: 'error',
summary: 'Metadata Update Failed',
life: 5000,
detail: 'An unexpected error occurred while scheduling the metadata update. Please try again later or contact support if the issue persists.'
});
}
return of({success: false});
})
);
}
getUploadCoverUrl(bookId: number): string {
return this.url + '/' + bookId + "/metadata/cover/upload"
}