From cc07b02e3b17ffa185429a73936d4338488a11a4 Mon Sep 17 00:00:00 2001 From: sbilketay Date: Mon, 17 Nov 2025 22:36:46 +0300 Subject: [PATCH] =?UTF-8?q?=C3=96zet=20kart=20tasar=C4=B1m=C4=B1=20de?= =?UTF-8?q?=C4=9Fi=C5=9Fti.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EpubStep.jsx | 24 ++++++++++++++++++++++-- src/components/UploadStep.jsx | 20 +++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/components/EpubStep.jsx b/src/components/EpubStep.jsx index b43184b..7717d23 100644 --- a/src/components/EpubStep.jsx +++ b/src/components/EpubStep.jsx @@ -155,7 +155,7 @@ const EpubStep = () => { )} - + {bookMetadata.title} @@ -165,7 +165,27 @@ const EpubStep = () => { )} - {[bookMetadata.publisher, bookMetadata.publishedDate, bookMetadata.pageCount ? `${bookMetadata.pageCount} sayfa` : null] + {[ + bookMetadata.publisher, + bookMetadata.publishedDate, + bookMetadata.pageCount ? `${bookMetadata.pageCount} sayfa` : null, + bookMetadata.language ? bookMetadata.language.toUpperCase() : null, + ] + .filter(Boolean) + .join(' • ')} + + + {[ + (() => { + const identifiers = bookMetadata.identifiers || []; + const isbnLike = + identifiers.find((id) => id.type?.includes('ISBN_13')) || + identifiers.find((id) => id.type?.includes('ISBN_10')) || + identifiers[0]; + return isbnLike?.identifier ? `ISBN ${isbnLike.identifier}` : null; + })(), + bookMetadata.averageRating ? `Puan ${bookMetadata.averageRating}/5` : null, + ] .filter(Boolean) .join(' • ')} diff --git a/src/components/UploadStep.jsx b/src/components/UploadStep.jsx index 82b1bb7..57955bb 100644 --- a/src/components/UploadStep.jsx +++ b/src/components/UploadStep.jsx @@ -49,7 +49,17 @@ const UploadStep = () => { const onDrop = useCallback( (acceptedFiles) => { if (!acceptedFiles.length) return; + const preservedMetadata = bookMetadata; + const preservedTitle = bookTitle; resetFromStep('upload'); + if (preservedMetadata) { + skipSearchRef.current = true; + setBookMetadata(preservedMetadata); + setBookTitle(preservedTitle || preservedMetadata.title || ''); + } else if (preservedTitle?.trim()) { + skipSearchRef.current = true; + setBookTitle(preservedTitle); + } const mapped = acceptedFiles.map((file, index) => ({ id: crypto.randomUUID(), file, @@ -59,7 +69,15 @@ const UploadStep = () => { })); setUploadedImages([...uploadedImages, ...mapped]); }, - [uploadedImages, resetFromStep, setUploadedImages], + [ + bookMetadata, + bookTitle, + resetFromStep, + setBookMetadata, + setBookTitle, + setUploadedImages, + uploadedImages, + ], ); const handleCoverToggle = (imageId) => {