rndusr / stig

TUI and CLI for the BitTorrent client Transmission
GNU General Public License v3.0
554 stars 24 forks source link

add features to get and set the seed ratio limit #201

Closed rsekman closed 2 years ago

rsekman commented 3 years ago

A few TODOs:

  1. Need a way to change the ratio limit mode between GLOBAL, SINGLE, and UNLIMITED. For ease of use the same command should be able to set the mode to both finite values and UNLIMITED (like how -1 sometimes means unlimited or disabled).
  2. Possibilities set
  3. The output from ls should be formatted like it is in details view; e.g. if the mode is GLOBAL and ratio-limit-enabled = false it should display disabled. The logic is the same as in details view but importing objects.remotecfg causes a circular import. I'm not familiar enough with the code to resolve or work around this.
  4. Annoyingly, the global properties do not follow the pattern of the other session properties (Sec 4.1 of the RPC spec), and they are seedRatio* in the RPC but ratio-limit* in the config file. Names in the code are possibly inconsistent and should be adjusted.
rndusr commented 3 years ago

Thank you.

Annoyingly, the global properties do not follow the pattern of the other session properties (Sec 4.1 of the RPC spec), and they are seedRatio* in the RPC but ratio-limit* in the config file.

stig implements an abstraction layer above Transmission's RPC and therefore uses its own naming schemes. Can you give examples for the inconsistencies you see?

I'll review this properly later this week.

rndusr commented 3 years ago

I've created a "ratio-limit" branch and made this feature somewhat usable.

There's still lots of work to do.

  1. stig ratiolimit should display the current global limit. That shouldn't be too hard.

  2. It would be nice if stig ratiolimit would also print all torrents with a custom ratio limit. To implement that properly, you'd have to add a "limit-ratio-mode" torrent filter.

  3. In the TUI, ratiolimit 123 global should set the default limit while ratiolimit 123 should set the limit for the marked or focused torrent(s). This is how ratelimit does it.

  4. In CLI mode, the default limit is displayed as "disconnected" because the relevant request is never made. I'm not sure if there is a good fix.