From b7f12b8bf644d163919de311368d4526ee5a1958 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Fri, 14 Feb 2025 12:57:44 +0100 Subject: [PATCH] refacto : komgaServiceConfig unused --- src/app/libraries/[libraryId]/page.tsx | 11 ++--------- src/app/page.tsx | 3 --- src/app/series/[seriesId]/page.tsx | 3 --- src/components/library/PaginatedSeriesGrid.tsx | 4 +--- src/components/library/SeriesGrid.tsx | 7 ++----- src/components/series/PaginatedBookGrid.tsx | 2 -- 6 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/app/libraries/[libraryId]/page.tsx b/src/app/libraries/[libraryId]/page.tsx index bb52aaa..e60abf4 100644 --- a/src/app/libraries/[libraryId]/page.tsx +++ b/src/app/libraries/[libraryId]/page.tsx @@ -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 (
@@ -52,7 +46,6 @@ export default async function LibraryPage({ params, searchParams }: PageProps) {
; diff --git a/src/app/series/[seriesId]/page.tsx b/src/app/series/[seriesId]/page.tsx index 0cb54e4..0278288 100644 --- a/src/app/series/[seriesId]/page.tsx +++ b/src/app/series/[seriesId]/page.tsx @@ -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) { - + diff --git a/src/components/library/SeriesGrid.tsx b/src/components/library/SeriesGrid.tsx index 3c592a7..f971da6 100644 --- a/src/components/library/SeriesGrid.tsx +++ b/src/components/library/SeriesGrid.tsx @@ -8,7 +8,6 @@ import { useRouter } from "next/navigation"; interface SeriesGridProps { series: KomgaSeries[]; - serverUrl: string; } // Fonction utilitaire pour obtenir les informations de lecture d'une série @@ -36,7 +35,7 @@ const getReadingStatusInfo = (series: KomgaSeries) => { }; }; -export function SeriesGrid({ series, serverUrl }: SeriesGridProps) { +export function SeriesGrid({ series }: SeriesGridProps) { const router = useRouter(); if (!series.length) { @@ -54,7 +53,6 @@ export function SeriesGrid({ series, serverUrl }: SeriesGridProps) { key={series.id} series={series} onClick={() => router.push(`/series/${series.id}`)} - serverUrl={serverUrl} /> ))} @@ -64,10 +62,9 @@ export function SeriesGrid({ series, serverUrl }: SeriesGridProps) { interface SeriesCardProps { series: KomgaSeries; onClick?: () => void; - serverUrl: string; } -function SeriesCard({ series, onClick, serverUrl }: SeriesCardProps) { +function SeriesCard({ series, onClick }: SeriesCardProps) { const [imageError, setImageError] = useState(false); const statusInfo = getReadingStatusInfo(series); diff --git a/src/components/series/PaginatedBookGrid.tsx b/src/components/series/PaginatedBookGrid.tsx index d5ab68d..4a94095 100644 --- a/src/components/series/PaginatedBookGrid.tsx +++ b/src/components/series/PaginatedBookGrid.tsx @@ -10,7 +10,6 @@ import { KomgaBook } from "@/types/komga"; interface PaginatedBookGridProps { books: KomgaBook[]; - serverUrl: string; currentPage: number; totalPages: number; totalElements: number; @@ -19,7 +18,6 @@ interface PaginatedBookGridProps { export function PaginatedBookGrid({ books, - serverUrl, currentPage, totalPages, totalElements,