Skip to content

Commit 5eb4dd3

Browse files
committed
add download count to torrent list
1 parent b6ae74f commit 5eb4dd3

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

api/src/tracker/announce.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,6 @@ const handleAnnounce = async (req, res) => {
122122
);
123123
}
124124

125-
console.log({
126-
bytes,
127-
uploaded,
128-
alreadyUploadedSession,
129-
uploadDeltaSession,
130-
downloaded,
131-
alreadyDownloadedSession,
132-
downloadDeltaSession,
133-
});
134-
135125
await Progress.findOneAndUpdate(
136126
{ userId: user._id, infoHash },
137127
{

client/components/TorrentList.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import slugify from "slugify";
66
import { ListUl } from "@styled-icons/boxicons-regular/ListUl";
77
import { Upload } from "@styled-icons/boxicons-regular/Upload";
88
import { Download } from "@styled-icons/boxicons-regular/Download";
9+
import { File } from "@styled-icons/boxicons-regular/File";
910
import { Chat } from "@styled-icons/boxicons-solid/Chat";
1011
import { ChevronsLeft } from "@styled-icons/boxicons-solid/ChevronsLeft";
1112
import { ChevronLeft } from "@styled-icons/boxicons-solid/ChevronLeft";
@@ -109,6 +110,20 @@ const TorrentList = ({ torrents = [], categories, total }) => {
109110
gridWidth: "100px",
110111
rightAlign: true,
111112
},
113+
{
114+
header: "Downloads",
115+
accessor: "downloads",
116+
cell: ({ value }) => (
117+
<Text
118+
icon={File}
119+
iconTextWrapperProps={{ justifyContent: "flex-end" }}
120+
>
121+
{value || 0}
122+
</Text>
123+
),
124+
gridWidth: "100px",
125+
rightAlign: true,
126+
},
112127
{
113128
header: "Comments",
114129
accessor: "comments.count",

0 commit comments

Comments
 (0)