diff --git a/src/client/components/ComicDetail/DownloadsPanel.tsx b/src/client/components/ComicDetail/DownloadsPanel.tsx index 75d93e0..8eb5d28 100644 --- a/src/client/components/ComicDetail/DownloadsPanel.tsx +++ b/src/client/components/ComicDetail/DownloadsPanel.tsx @@ -8,7 +8,7 @@ import axios from "axios"; import { LIBRARY_SERVICE_BASE_URI, QBITTORRENT_SERVICE_BASE_URI, - JOB_QUEUE_SERVICE_BASE_URI, + TORRENT_JOB_SERVICE_BASE_URI, } from "../../constants/endpoints"; import { useStore } from "../../store"; import { useShallow } from "zustand/react/shallow"; @@ -60,20 +60,6 @@ export const DownloadsPanel = ( }), }); - // const { - // data: torrentProperties, - // isSuccess: torrentPropertiesFetched, - // isFetching: torrentPropertiesFetching, - // } = useQuery({ - // queryFn: async () => - // await axios({ - // url: `${QBITTORRENT_SERVICE_BASE_URI}/getTorrentProperties`, - // method: "POST", - // data: { infoHashes }, - // }), - // queryKey: ["torrentProperties", infoHashes], - // }); - const getBundles = async (comicObject) => { if (comicObject?.data.acquisition.directconnect) { const filteredBundles = @@ -91,7 +77,7 @@ export const DownloadsPanel = ( const { data: torrentData } = useQuery({ queryFn: () => axios({ - url: `${JOB_QUEUE_SERVICE_BASE_URI}/getTorrentData`, + url: `${TORRENT_JOB_SERVICE_BASE_URI}/getTorrentData`, method: "GET", params: { trigger: activeTab, diff --git a/src/client/components/ComicDetail/TorrentDownloads.tsx b/src/client/components/ComicDetail/TorrentDownloads.tsx index b5aa0fe..d6e4b89 100644 --- a/src/client/components/ComicDetail/TorrentDownloads.tsx +++ b/src/client/components/ComicDetail/TorrentDownloads.tsx @@ -9,21 +9,52 @@ export const TorrentDownloads = (props) => { <> {data.map(({ torrent }) => { return ( -
{torrent.hash}
Added on {dayjs.unix(torrent.added_on).format("ddd, D MMM, YYYY")}
-{torrent.progress}
+ ++ {torrent.progress > 0 ? ( + <> + + + {Math.floor(torrent.progress * 100)}% + + {/* downloaded/left */} + + + + + + {prettyBytes(torrent.downloaded)} + + + {/* uploaded */} + + + + + {prettyBytes(torrent.uploaded)} + + + > + ) : null} +