perf: promise all on ssr pages

This commit is contained in:
Julien Froidefond
2025-10-07 18:03:53 +02:00
parent 6f1889931c
commit ecaf804d02
2 changed files with 8 additions and 15 deletions

View File

@@ -42,14 +42,10 @@ async function getLibrarySeries(
try { try {
const pageIndex = page - 1; const pageIndex = page - 1;
const series: LibraryResponse<KomgaSeries> = await LibraryService.getLibrarySeries( const [series, library] = await Promise.all([
libraryId, LibraryService.getLibrarySeries(libraryId, pageIndex, size, unreadOnly, search),
pageIndex, LibraryService.getLibrary(libraryId)
size, ]);
unreadOnly,
search
);
const library: KomgaLibrary = await LibraryService.getLibrary(libraryId);
return { data: series, library }; return { data: series, library };
} catch (error) { } catch (error) {

View File

@@ -27,13 +27,10 @@ async function getSeriesBooks(
try { try {
const pageIndex = page - 1; const pageIndex = page - 1;
const books: LibraryResponse<KomgaBook> = await SeriesService.getSeriesBooks( const [books, series] = await Promise.all([
seriesId, SeriesService.getSeriesBooks(seriesId, pageIndex, size, unreadOnly),
pageIndex, SeriesService.getSeries(seriesId)
size, ]);
unreadOnly
);
const series: KomgaSeries = await SeriesService.getSeries(seriesId);
return { data: books, series }; return { data: books, series };
} catch (error) { } catch (error) {