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 {
const pageIndex = page - 1;
const series: LibraryResponse<KomgaSeries> = await LibraryService.getLibrarySeries(
libraryId,
pageIndex,
size,
unreadOnly,
search
);
const library: KomgaLibrary = await LibraryService.getLibrary(libraryId);
const [series, library] = await Promise.all([
LibraryService.getLibrarySeries(libraryId, pageIndex, size, unreadOnly, search),
LibraryService.getLibrary(libraryId)
]);
return { data: series, library };
} catch (error) {

View File

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