diff --git a/src/client/actions/airdcpp.actions.tsx b/src/client/actions/airdcpp.actions.tsx index 0fe54a4..5a33f37 100644 --- a/src/client/actions/airdcpp.actions.tsx +++ b/src/client/actions/airdcpp.actions.tsx @@ -148,30 +148,7 @@ export const downloadAirDCPPItem = ); } if (!isNil(downloadResult)) { - bundleDBImportResult = await axios({ - method: "POST", - url: `${LIBRARY_SERVICE_BASE_URI}/applyAirDCPPDownloadMetadata`, - headers: { - "Content-Type": "application/json; charset=utf-8", - }, - data: { - resultId, - comicObjectId, - searchInstanceId: instanceId, - bundleId, - directoryIds, - }, - }); - dispatch({ - type: AIRDCPP_RESULT_DOWNLOAD_INITIATED, - downloadResult: downloadResult, - bundleDBImportResult, - }); - dispatch({ - type: IMS_COMIC_BOOK_DB_OBJECT_FETCHED, - comicBookDetail: bundleDBImportResult.data, - IMS_inProgress: false, - }); + } } catch (error) { throw error; diff --git a/src/client/components/App.tsx b/src/client/components/App.tsx index a50df9c..0eb686c 100644 --- a/src/client/components/App.tsx +++ b/src/client/components/App.tsx @@ -23,10 +23,12 @@ import { import { isEmpty, isUndefined } from "lodash"; import { AIRDCPP_DOWNLOAD_PROGRESS_TICK } from "../constants/action-types"; import { useDispatch } from "react-redux"; +import axios from "axios"; +import { LIBRARY_SERVICE_BASE_URI } from "../constants/endpoints"; +import { useParams } from "react-router"; const AirDCPPSocketComponent = (): ReactElement => { const airDCPPConfiguration = useContext(AirDCPPSocketContext); - console.log(airDCPPConfiguration); const dispatch = useDispatch(); useEffect(() => { const foo = async () => { @@ -38,7 +40,36 @@ const AirDCPPSocketComponent = (): ReactElement => { await airDCPPConfiguration.airDCPPState.socket.addListener( "queue", "queue_bundle_added", - async (data) => console.log("JEMEN:", data), + async (data) => { + console.log("JEMEN:", data); + const { id, name, size, target, time_added, type } = data; + const downloadResultMetadata = await axios({ + method: "POST", + url: `${LIBRARY_SERVICE_BASE_URI}/applyAirDCPPDownloadMetadata`, + headers: { + "Content-Type": "application/json; charset=utf-8", + }, + data: { + bundleId: id, + name, + size, + target, + time_added, + type + }, + }); + // dispatch({ + // type: AIRDCPP_RESULT_DOWNLOAD_INITIATED, + // downloadResult: downloadResult, + // bundleDBImportResult, + // }); + // dispatch({ + // type: IMS_COMIC_BOOK_DB_OBJECT_FETCHED, + // comicBookDetail: bundleDBImportResult.data, + // IMS_inProgress: false, + // }); + + } ); // download tick listener await airDCPPConfiguration.airDCPPState.socket.addListener( diff --git a/src/client/components/ComicDetail/AcquisitionPanel.tsx b/src/client/components/ComicDetail/AcquisitionPanel.tsx index b39d166..0031428 100644 --- a/src/client/components/ComicDetail/AcquisitionPanel.tsx +++ b/src/client/components/ComicDetail/AcquisitionPanel.tsx @@ -245,6 +245,7 @@ export const AcquisitionPanel = ( {map(airDCPPSearchResults, ({ result }, idx) => { + console.log(result); return ( { const [active, setActive] = useState(filteredTabs[0].id); useEffect(() => { - console.log(comicBookDetailData); setActive(filteredTabs[0].id); }, [comicBookDetailData]); diff --git a/src/client/components/Navbar.tsx b/src/client/components/Navbar.tsx index c792914..ef96451 100644 --- a/src/client/components/Navbar.tsx +++ b/src/client/components/Navbar.tsx @@ -9,7 +9,6 @@ const Navbar: React.FunctionComponent = (props) => { const downloadProgressTick = useSelector( (state: RootState) => state.airdcpp.downloadProgressData, ); - console.log(downloadProgressTick); return (