refacto : komgaServiceConfig unused

This commit is contained in:
Julien Froidefond
2025-02-14 12:57:44 +01:00
parent bd652fc1ff
commit b7f12b8bf6
6 changed files with 5 additions and 25 deletions

View File

@@ -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}

View File

@@ -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} />;

View File

@@ -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}