diff --git a/src/client/components/ComicDetail/ComicDetail.tsx b/src/client/components/ComicDetail/ComicDetail.tsx index be36862..293982c 100644 --- a/src/client/components/ComicDetail/ComicDetail.tsx +++ b/src/client/components/ComicDetail/ComicDetail.tsx @@ -357,7 +357,12 @@ export const ComicDetail = (data: ComicDetailProps): ReactElement => { { id: 6, name: "Downloads", - icon: <>{acquisition?.directconnect?.downloads?.length}, + icon: ( + <> + {acquisition?.directconnect?.downloads?.length + + acquisition?.torrent.length} + + ), content: !isNil(data.data) && !isEmpty(data.data) ? ( diff --git a/src/client/components/ComicDetail/ComicDetailContainer.tsx b/src/client/components/ComicDetail/ComicDetailContainer.tsx index 4701f3f..312def2 100644 --- a/src/client/components/ComicDetail/ComicDetailContainer.tsx +++ b/src/client/components/ComicDetail/ComicDetailContainer.tsx @@ -1,7 +1,5 @@ -import { isEmpty, isNil, isUndefined } from "lodash"; -import React, { ReactElement, useContext, useEffect, useState } from "react"; +import React, { ReactElement } from "react"; import { useParams } from "react-router-dom"; -import { getComicBookDetailById } from "../../actions/comicinfo.actions"; import { ComicDetail } from "../ComicDetail/ComicDetail"; import { useQuery } from "@tanstack/react-query"; import { LIBRARY_SERVICE_BASE_URI } from "../../constants/endpoints"; diff --git a/src/client/components/ComicDetail/DownloadsPanel.tsx b/src/client/components/ComicDetail/DownloadsPanel.tsx index 618e78c..5c13e0a 100644 --- a/src/client/components/ComicDetail/DownloadsPanel.tsx +++ b/src/client/components/ComicDetail/DownloadsPanel.tsx @@ -53,9 +53,9 @@ export const DownloadsPanel = ( } = useQuery({ queryFn: async () => await axios({ - url: `${QBITTORRENT_SERVICE_BASE_URI}/getTorrentDetails`, + url: `${QBITTORRENT_SERVICE_BASE_URI}/getTorrentProperties`, method: "POST", - data: infoHashes, + data: { infoHashes }, }), queryKey: ["torrentProperties", infoHashes], }); @@ -88,6 +88,7 @@ export const DownloadsPanel = ( ), ), ]; + console.log(infoHashes); return newInfoHashes; }); } diff --git a/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx b/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx index 6304884..d1edfc9 100644 --- a/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx +++ b/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx @@ -30,6 +30,8 @@ export const ArchiveOperations = (props): ReactElement => { const [currentImage, setCurrentImage] = useState([]); const [uncompressedArchive, setUncompressedArchive] = useState([]); const [imageAnalysisResult, setImageAnalysisResult] = useState({}); + const [shouldRefetchComicBookData, setShouldRefetchComicBookData] = + useState(false); const constructImagePaths = (data): Array => { return data?.map((path: string) => escapePoundSymbol(encodeURI(`${LIBRARY_SERVICE_HOST}/${path}`)), @@ -63,6 +65,7 @@ export const ArchiveOperations = (props): ReactElement => { if (isMounted) { setUncompressedArchive(uncompressedArchive); + setShouldRefetchComicBookData(true); } }, }); @@ -122,8 +125,9 @@ export const ArchiveOperations = (props): ReactElement => { enabled: false, }); - if (isSuccess) { + if (isSuccess && shouldRefetchComicBookData) { queryClient.invalidateQueries({ queryKey: ["comicBookMetadata"] }); + setShouldRefetchComicBookData(false); } // sliding panel init @@ -171,7 +175,8 @@ export const ArchiveOperations = (props): ReactElement => {
- {data.rawFileDetails.archive?.uncompressed ? ( + {data.rawFileDetails.archive?.uncompressed && + !isEmpty(uncompressedArchive) ? (
{ ) : null}
- {!data.rawFileDetails?.archive?.uncompressed ? ( + {isEmpty(uncompressedArchive) ? ( - - ))} - + +
+
+ The default search term is an auto-detected title; you may need to + change it to get better matches if the auto-detected one doesn't work. +
+
+ {!isEmpty(data?.data) ? ( +
+ + + + + + + + + + + {data?.data.map((result, idx) => ( + + + + + + + + ))} + +
+ Name + + Indexer + + Action +
+

{ellipsize(result.fileName, 90)}

+ {/* Seeders/Leechers */} +
+ + + + + + + {result.seeders} seeders + + + + + + + + + + {result.leechers} leechers + + + {/* Size */} + + + + + + + {prettyBytes(result.size)} + + + + {/* Files */} + + + + + + + {result.files} files + + +
+
+ {result.indexer} + + +
+
+ ) : null} ); };