Spaces:
Paused
Paused
Upload 25 files
Browse files- app.py +2 -7
- docker-compose.yml +12 -11
- static/app.js +0 -10
app.py
CHANGED
|
@@ -391,10 +391,8 @@ def effective_state_label(torrent, state_entry: dict | None = None) -> str:
|
|
| 391 |
progress = float(getattr(torrent, "progress", 0) or 0)
|
| 392 |
|
| 393 |
if progress >= 1:
|
| 394 |
-
if raw_state in {"uploading", "forcedUP"}:
|
| 395 |
return "Seeding"
|
| 396 |
-
if raw_state == "stalledUP":
|
| 397 |
-
return "Stalled Up"
|
| 398 |
if raw_state == "pausedUP":
|
| 399 |
return "Paused"
|
| 400 |
if raw_state == "queuedUP":
|
|
@@ -413,14 +411,11 @@ def effective_status_badge(torrent, state_entry: dict | None = None) -> str:
|
|
| 413 |
progress = float(getattr(torrent, "progress", 0) or 0)
|
| 414 |
upspeed = int(getattr(torrent, "upspeed", 0) or 0)
|
| 415 |
|
| 416 |
-
if progress >= 1 and raw_state in {"uploading", "forcedUP"}:
|
| 417 |
if upspeed > 0:
|
| 418 |
return "border-sky-500/30 bg-sky-500/10 text-sky-100"
|
| 419 |
return "border-lime/30 bg-lime/10 text-lime"
|
| 420 |
|
| 421 |
-
if progress >= 1 and raw_state == "stalledUP":
|
| 422 |
-
return "border-amber-500/30 bg-amber-500/10 text-amber-100"
|
| 423 |
-
|
| 424 |
return status_badge(raw_state)
|
| 425 |
|
| 426 |
|
|
|
|
| 391 |
progress = float(getattr(torrent, "progress", 0) or 0)
|
| 392 |
|
| 393 |
if progress >= 1:
|
| 394 |
+
if raw_state in {"uploading", "forcedUP", "stalledUP"}:
|
| 395 |
return "Seeding"
|
|
|
|
|
|
|
| 396 |
if raw_state == "pausedUP":
|
| 397 |
return "Paused"
|
| 398 |
if raw_state == "queuedUP":
|
|
|
|
| 411 |
progress = float(getattr(torrent, "progress", 0) or 0)
|
| 412 |
upspeed = int(getattr(torrent, "upspeed", 0) or 0)
|
| 413 |
|
| 414 |
+
if progress >= 1 and raw_state in {"uploading", "forcedUP", "stalledUP"}:
|
| 415 |
if upspeed > 0:
|
| 416 |
return "border-sky-500/30 bg-sky-500/10 text-sky-100"
|
| 417 |
return "border-lime/30 bg-lime/10 text-lime"
|
| 418 |
|
|
|
|
|
|
|
|
|
|
| 419 |
return status_badge(raw_state)
|
| 420 |
|
| 421 |
|
docker-compose.yml
CHANGED
|
@@ -4,21 +4,22 @@ services:
|
|
| 4 |
context: .
|
| 5 |
dockerfile: Dockerfile
|
| 6 |
container_name: torrent-app
|
| 7 |
-
environment:
|
| 8 |
-
FLASK_SECRET_KEY: change-me
|
| 9 |
-
PORT: 5000
|
| 10 |
-
QBITTORRENT_HOST: 127.0.0.1
|
| 11 |
-
QBITTORRENT_PORT: 8080
|
| 12 |
QBITTORRENT_USERNAME: admin
|
| 13 |
QBITTORRENT_PASSWORD: adminadmin
|
| 14 |
QBITTORRENT_SAVE_PATH: /downloads
|
| 15 |
QBT_PROFILE: /config
|
| 16 |
-
QBITTORRENT_TORRENT_PORT: 6881
|
| 17 |
-
QBITTORRENT_TORRENT_SSL_PORT: 14906
|
| 18 |
-
ports:
|
| 19 |
-
- "5000:5000"
|
| 20 |
-
- "6881:6881"
|
| 21 |
-
- "6881:6881/udp"
|
|
|
|
| 22 |
volumes:
|
| 23 |
- ./downloads:/downloads
|
| 24 |
- ./qbittorrent/config:/config
|
|
|
|
| 4 |
context: .
|
| 5 |
dockerfile: Dockerfile
|
| 6 |
container_name: torrent-app
|
| 7 |
+
environment:
|
| 8 |
+
FLASK_SECRET_KEY: change-me
|
| 9 |
+
PORT: 5000
|
| 10 |
+
QBITTORRENT_HOST: 127.0.0.1
|
| 11 |
+
QBITTORRENT_PORT: 8080
|
| 12 |
QBITTORRENT_USERNAME: admin
|
| 13 |
QBITTORRENT_PASSWORD: adminadmin
|
| 14 |
QBITTORRENT_SAVE_PATH: /downloads
|
| 15 |
QBT_PROFILE: /config
|
| 16 |
+
QBITTORRENT_TORRENT_PORT: ${QBITTORRENT_TORRENT_PORT:-6881}
|
| 17 |
+
QBITTORRENT_TORRENT_SSL_PORT: ${QBITTORRENT_TORRENT_SSL_PORT:-14906}
|
| 18 |
+
ports:
|
| 19 |
+
- "5000:5000"
|
| 20 |
+
- "${QBITTORRENT_TORRENT_PORT:-6881}:${QBITTORRENT_TORRENT_PORT:-6881}"
|
| 21 |
+
- "${QBITTORRENT_TORRENT_PORT:-6881}:${QBITTORRENT_TORRENT_PORT:-6881}/udp"
|
| 22 |
+
- "${QBITTORRENT_TORRENT_SSL_PORT:-14906}:${QBITTORRENT_TORRENT_SSL_PORT:-14906}"
|
| 23 |
volumes:
|
| 24 |
- ./downloads:/downloads
|
| 25 |
- ./qbittorrent/config:/config
|
static/app.js
CHANGED
|
@@ -107,16 +107,6 @@
|
|
| 107 |
}
|
| 108 |
|
| 109 |
const label = normalizeStateLabel(torrent.state_label);
|
| 110 |
-
if (label.includes("stalled up")) {
|
| 111 |
-
return {
|
| 112 |
-
dotClass: "bg-amber",
|
| 113 |
-
dotStyle: "background-color: #f7c84b;",
|
| 114 |
-
text: "text-amber",
|
| 115 |
-
pillClass: "text-amber-100",
|
| 116 |
-
pillStyle: "background-color: rgba(247, 200, 75, 0.18); box-shadow: inset 0 0 0 1px rgba(247, 200, 75, 0.22);",
|
| 117 |
-
label: torrent.state_label || "Stalled Up",
|
| 118 |
-
};
|
| 119 |
-
}
|
| 120 |
if (label.includes("download")) {
|
| 121 |
return {
|
| 122 |
dotClass: "bg-neon",
|
|
|
|
| 107 |
}
|
| 108 |
|
| 109 |
const label = normalizeStateLabel(torrent.state_label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
if (label.includes("download")) {
|
| 111 |
return {
|
| 112 |
dotClass: "bg-neon",
|