From 2879df114dce23480a238f5ea79cff4a260be468 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Mon, 3 Jun 2024 17:12:49 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20kafka-powered=20search=20+=20dow?= =?UTF-8?q?nload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComicDetail/AcquisitionPanel.tsx | 18 +++++++++--------- src/client/components/Search/Search.tsx | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client/components/ComicDetail/AcquisitionPanel.tsx b/src/client/components/ComicDetail/AcquisitionPanel.tsx index b54ea3f..81e5444 100644 --- a/src/client/components/ComicDetail/AcquisitionPanel.tsx +++ b/src/client/components/ComicDetail/AcquisitionPanel.tsx @@ -125,26 +125,26 @@ export const AcquisitionPanel = ( ); }; - socketIOInstance.on("searchResultAdded", (data: SearchResult) => { + socketIOInstance.on("searchResultAdded", ({ groupedResult }: any) => { setAirDCPPSearchResults((previousState) => { const exists = previousState.some( - (item) => data.result.id === item.result.id, + (item) => groupedResult.result.id === item.result.id, ); if (!exists) { - return [...previousState, data]; + return [...previousState, groupedResult]; } return previousState; }); }); - socketIOInstance.on("searchResultUpdated", (groupedResult: SearchResult) => { + socketIOInstance.on("searchResultUpdated", ({ updatedResult }: any) => { // ...update properties of the existing result in the UI const bundleToUpdateIndex = airDCPPSearchResults?.findIndex( - (bundle) => bundle.result.id === groupedResult.result.id, + (bundle) => bundle.result.id === updatedResult.result.id, ); const updatedState = [...airDCPPSearchResults]; - if (!isNil(difference(updatedState[bundleToUpdateIndex], groupedResult))) { - updatedState[bundleToUpdateIndex] = groupedResult; + if (!isNil(difference(updatedState[bundleToUpdateIndex], updatedResult))) { + updatedState[bundleToUpdateIndex] = updatedResult; } setAirDCPPSearchResults((state) => [...state, ...updatedState]); }); @@ -255,8 +255,8 @@ export const AcquisitionPanel = (
- AirDC++ is not configured. Please configure it in{" "} - Settings > AirDC++ > Connection. + No AirDC++ hub configured. Please configure it in{" "} + Settings > AirDC++ > Hubs.
diff --git a/src/client/components/Search/Search.tsx b/src/client/components/Search/Search.tsx index 40aa84d..d755bcb 100644 --- a/src/client/components/Search/Search.tsx +++ b/src/client/components/Search/Search.tsx @@ -63,7 +63,6 @@ export const Search = ({}: ISearchProps): ReactElement => { markEntireVolumeWanted, resourceType, }) => { - console.log("jigni", comicObject); let volumeInformation = {}; let issues = []; switch (resourceType) { @@ -73,11 +72,12 @@ export const Search = ({}: ISearchProps): ReactElement => { // Add issue metadata issues.push({ id, - api_detail_url, + url: api_detail_url, image, coverDate: cover_date, issueNumber: issue_number, }); + console.log(issues); // Get volume metadata from CV const response = await axios({ url: `${COMICVINE_SERVICE_URI}/getVolumes`,