Skip to content

Commit

Permalink
add download count to torrent list
Browse files Browse the repository at this point in the history
  • Loading branch information
tdjsnelling committed Mar 19, 2023
1 parent b6ae74f commit 5eb4dd3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
10 changes: 0 additions & 10 deletions api/src/tracker/announce.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,6 @@ const handleAnnounce = async (req, res) => {
);
}

console.log({
bytes,
uploaded,
alreadyUploadedSession,
uploadDeltaSession,
downloaded,
alreadyDownloadedSession,
downloadDeltaSession,
});

await Progress.findOneAndUpdate(
{ userId: user._id, infoHash },
{
Expand Down
15 changes: 15 additions & 0 deletions client/components/TorrentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import slugify from "slugify";
import { ListUl } from "@styled-icons/boxicons-regular/ListUl";
import { Upload } from "@styled-icons/boxicons-regular/Upload";
import { Download } from "@styled-icons/boxicons-regular/Download";
import { File } from "@styled-icons/boxicons-regular/File";
import { Chat } from "@styled-icons/boxicons-solid/Chat";
import { ChevronsLeft } from "@styled-icons/boxicons-solid/ChevronsLeft";
import { ChevronLeft } from "@styled-icons/boxicons-solid/ChevronLeft";
Expand Down Expand Up @@ -109,6 +110,20 @@ const TorrentList = ({ torrents = [], categories, total }) => {
gridWidth: "100px",
rightAlign: true,
},
{
header: "Downloads",
accessor: "downloads",
cell: ({ value }) => (
<Text
icon={File}
iconTextWrapperProps={{ justifyContent: "flex-end" }}
>
{value || 0}
</Text>
),
gridWidth: "100px",
rightAlign: true,
},
{
header: "Comments",
accessor: "comments.count",
Expand Down

0 comments on commit 5eb4dd3

Please sign in to comment.