Skip to content

Commit e32a205

Browse files
committed
Add links to the status page to details of download
1 parent eb9841e commit e32a205

7 files changed

Lines changed: 1092 additions & 911 deletions

File tree

frontend/src/Manage/Status/StatusItem.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
LinearProgress,
88
LinearProgressProps,
99
IconButton,
10+
Link,
1011
} from '@mui/material'
1112
import PlayArrowIcon from '@mui/icons-material/PlayArrow'
1213
import PauseIcon from '@mui/icons-material/Pause'
@@ -147,7 +148,21 @@ export const StatusItem = ({
147148
}}
148149
>
149150
<ListItemText
150-
primary={separateWords(torrent.name)}
151+
primary={
152+
<Link
153+
href={torrent.detailsUrl}
154+
underline="hover"
155+
color="inherit"
156+
sx={{
157+
display: 'block',
158+
'&:hover': {
159+
color: 'primary.main',
160+
},
161+
}}
162+
>
163+
{separateWords(torrent.name)}
164+
</Link>
165+
}
151166
secondary={
152167
<LinearProgressWithLabel
153168
variant="determinate"

frontend/src/Manage/Status/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export interface Torrent {
99
| 'error'
1010
| 'complete'
1111
| 'queued'
12+
detailsUrl?: string
1213
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "CDMServer"
3-
version = "2.8.2"
3+
version = "2.9.0"
44
description = "A short description of your project"
55
authors = [{name = "Aron Radics", email = "radics.aron.jozsef@gmail.com"}]
66
requires-python = ">=3.13"

requirements-dev.txt

Lines changed: 561 additions & 478 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 510 additions & 431 deletions
Large diffs are not rendered by default.

service/api/status.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from copy import copy
22
from fastapi.responses import JSONResponse
33
from fastapi import APIRouter, Depends
4+
from ncoreparser import get_torrent_page_url
45
from service.util.auth import manager
56
from service.models.api import TorrentStatusData, InstructionsData
67
from service.models.database import (
@@ -72,4 +73,5 @@ def dump_torrent(torrent: TorrentStatus) -> dict:
7273
eta=torrent.eta,
7374
downloadDir=torrent.download_dir,
7475
totalSize=torrent.total_size,
76+
detailsUrl=get_torrent_page_url(torrent_id=str(torrent.tracker_id)) if torrent.tracker_id else None,
7577
).model_dump()

service/models/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class TorrentStatusData(BaseData):
121121
eta: int | None
122122
downloadDir: str
123123
totalSize: int
124+
detailsUrl: str | None = None
124125

125126

126127
class StatusDataItem(BaseData):

0 commit comments

Comments
 (0)