adding availability
Some checks failed
Build and Deploy (internal) / Build Transmission Manager Image (push) Failing after 0s
Build and Deploy (internal) / Deploy Transmission Manager (internal) (push) Has been skipped

This commit is contained in:
2026-07-08 20:01:02 -03:00
parent a57002bf44
commit 7d1b868107
4 changed files with 59 additions and 10 deletions

View File

@@ -56,13 +56,15 @@ Torrent list requests should include:
id, name, totalSize, downloadedEver, uploadedEver, uploadRatio,
percentDone, status, eta, error, errorString, doneDate, isFinished,
rateDownload, rateUpload, peersConnected, peersGettingFromUs, peersSendingToUs,
peers
availability, peers
```
Peer objects are expected to include `address`, `clientName`, `progress`, `isDownloadingFrom`, `isUploadingTo`, `rateToClient`, and `rateToPeer` when available.
The UI definition of "peers at 100%" is an absolute count of `peers[]` entries whose `progress === 1.0`. Do not reinterpret it as a percentage of connected peers.
The UI availability value comes from Transmission's `availability` per-piece array. Render and sort it as a complete-copy estimate, treating `-1` entries as pieces available locally.
## Frontend Architecture
The frontend is a single page with module-level state in `web/app.js`. It polls on a user-selectable interval, defaults to 3 seconds, and fetches torrents and stats in parallel.
@@ -84,7 +86,7 @@ Current sort keys:
- `ratio`
- `size`
- `speed`: orders by combined download and upload speed descending, then download speed, upload speed, and name.
- `peer100`: orders by peers at 100% descending, then connected peers descending, progress descending, and name ascending.
- `availability`: orders by computed availability descending, then progress, then name.
## UI And Design Rules