Fix: regenerate improvements (#1981)
* chore: report error on cover regeneration fail * refactor: use RxJS forkJoin instead of Promise.all - Replace Promise-based approach with RxJS forkJoin for better consistency - Remove console.log debug statement - Improve error handling with proper RxJS operators Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com> * chore: cleanup * chore: rework per development upstream * chore: updating books on bulk cover regenerate * chore: working * chore: metadata regenerateCover pdate UI * chore: review per comments --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
farfromrefug
copilot-swe-agent[bot]
parent
77e06b868e
commit
f5e99d52c1
+16
-12
@@ -654,18 +654,22 @@ export class MetadataEditorComponent implements OnInit {
|
||||
regenerateCover(bookId: number) {
|
||||
this.bookService.regenerateCover(bookId).subscribe({
|
||||
next: () => {
|
||||
this.messageService.add({
|
||||
severity: "success",
|
||||
summary: "Success",
|
||||
detail:
|
||||
"Book cover regenerated successfully. Refresh page to see the new cover.",
|
||||
});
|
||||
},
|
||||
error: () => {
|
||||
this.messageService.add({
|
||||
severity: "error",
|
||||
summary: "Error",
|
||||
detail: "Failed to start cover regeneration",
|
||||
this.bookService.getBookByIdFromAPI(bookId, false).subscribe({
|
||||
next: (updatedBook) => {
|
||||
this.bookService.handleBookUpdate(updatedBook);
|
||||
this.messageService.add({
|
||||
severity: "success",
|
||||
summary: "Success",
|
||||
detail: "Book cover regenerated successfully.",
|
||||
});
|
||||
},
|
||||
error: () => {
|
||||
this.messageService.add({
|
||||
severity: "warning",
|
||||
summary: "Partial Success",
|
||||
detail: "Cover regenerated but failed to refresh display. Please refresh the page.",
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user