refacto : komgaServiceConfig unused
This commit is contained in:
@@ -12,8 +12,6 @@ const PAGE_SIZE = 20;
|
||||
|
||||
async function getLibrarySeries(libraryId: string, page: number = 1, unreadOnly: boolean = false) {
|
||||
try {
|
||||
const cookiesStore = cookies();
|
||||
const config = komgaConfigService.validateAndGetConfig(cookiesStore);
|
||||
const pageIndex = page - 1;
|
||||
|
||||
const series = await LibraryService.getLibrarySeries(
|
||||
@@ -23,7 +21,7 @@ async function getLibrarySeries(libraryId: string, page: number = 1, unreadOnly:
|
||||
unreadOnly
|
||||
);
|
||||
|
||||
return { data: series, serverUrl: config.serverUrl };
|
||||
return { data: series };
|
||||
} catch (error) {
|
||||
throw error instanceof Error ? error : new Error("Erreur lors de la récupération des séries");
|
||||
}
|
||||
@@ -34,11 +32,7 @@ export default async function LibraryPage({ params, searchParams }: PageProps) {
|
||||
const unreadOnly = searchParams.unread === "true";
|
||||
|
||||
try {
|
||||
const { data: series, serverUrl } = await getLibrarySeries(
|
||||
params.libraryId,
|
||||
currentPage,
|
||||
unreadOnly
|
||||
);
|
||||
const { data: series } = await getLibrarySeries(params.libraryId, currentPage, unreadOnly);
|
||||
|
||||
return (
|
||||
<div className="container py-8 space-y-8">
|
||||
@@ -52,7 +46,6 @@ export default async function LibraryPage({ params, searchParams }: PageProps) {
|
||||
</div>
|
||||
<PaginatedSeriesGrid
|
||||
series={series.content || []}
|
||||
serverUrl={serverUrl}
|
||||
currentPage={currentPage}
|
||||
totalPages={series.totalPages}
|
||||
totalElements={series.totalElements}
|
||||
|
||||
@@ -6,9 +6,6 @@ import { redirect } from "next/navigation";
|
||||
|
||||
export default async function HomePage() {
|
||||
try {
|
||||
const cookiesStore = cookies();
|
||||
komgaConfigService.validateAndGetConfig(cookiesStore);
|
||||
|
||||
const data = await HomeService.getHomeData();
|
||||
|
||||
return <HomeContent data={data} />;
|
||||
|
||||
@@ -17,8 +17,6 @@ export default async function SeriesPage({ params, searchParams }: PageProps) {
|
||||
const unreadOnly = searchParams.unread === "true";
|
||||
|
||||
try {
|
||||
const cookiesStore = cookies();
|
||||
const config = komgaConfigService.validateAndGetConfig(cookiesStore);
|
||||
const pageIndex = currentPage - 1;
|
||||
|
||||
// Appels API parallèles pour les détails de la série et les tomes
|
||||
@@ -32,7 +30,6 @@ export default async function SeriesPage({ params, searchParams }: PageProps) {
|
||||
<SeriesHeader series={series} />
|
||||
<PaginatedBookGrid
|
||||
books={books.content || []}
|
||||
serverUrl={config.serverUrl}
|
||||
currentPage={currentPage}
|
||||
totalPages={books.totalPages}
|
||||
totalElements={books.totalElements}
|
||||
|
||||
Reference in New Issue
Block a user