diff --git a/docs/environment-variables.md b/docs/environment-variables.md index 75a49c31..a6624365 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -2340,7 +2340,7 @@ How long to keep cached search results before they expire. | `RTORRENT_DOWNLOAD_DIR_AUDIOBOOK` | Server-side directory where audiobook torrents are downloaded (optional, uses rTorrent default if not specified) | string | _none_ | | `PROWLARR_TORRENT_ACTION` | After a successful import, Remove keeps downloaded files in qBittorrent, Transmission, and Deluge; Remove & Delete Files also deletes them. rTorrent cannot delete download data, so this action leaves its torrent untouched. Blackhole does not support removal. Debrid clients delete temporary local files for either Remove action. | string (choice) | `keep` | | `TORRENT_NO_SEEDERS_WAIT` | Give up on a torrent when its client sees no seed at all for this long, even while it is still downloading, or fewer seeds than the minimum below while nothing is downloading. The torrent is removed and the download marked failed, so another release can be tried. The card shows the seed count and a countdown while it waits. 0 keeps the default behaviour (only the stall timer ends it). Only qBittorrent reports seed counts. | number | `0` | -| `TORRENT_MIN_SEEDERS` | Seeds the client must see for a motionless torrent to keep waiting. 0 also turns the no-seed check off. | number | `1` | +| `TORRENT_MIN_SEEDERS` | Seeds the client must see for a motionless torrent to keep waiting. 0 also turns the no-seed check off. Only qBittorrent reports seed counts. | number | `1` | | `PROWLARR_TORRENT_POST_IMPORT_CATEGORY` | Category or label to assign after a successful import | string | _empty string_ | | `TORRENT_STALL_TIMEOUT_MINUTES` | How long a torrent can go without any progress before Shelfmark cancels it. Applies from when the torrent starts and restarts each time it moves. Raise it for slow swarms or magnets that take a while to find peers, or lower it to give up on dead torrents sooner. | number | `15` | | `PROWLARR_USENET_CLIENT` | Choose which usenet client to use | string (choice) | _empty string_ | @@ -2779,7 +2779,7 @@ Give up on a torrent when its client sees no seed at all for this long, even whi **Minimum Seeders** -Seeds the client must see for a motionless torrent to keep waiting. 0 also turns the no-seed check off. +Seeds the client must see for a motionless torrent to keep waiting. 0 also turns the no-seed check off. Only qBittorrent reports seed counts. - **Type:** number - **Default:** `1` diff --git a/shelfmark/download/clients/settings.py b/shelfmark/download/clients/settings.py index dd79b324..67a62a7a 100644 --- a/shelfmark/download/clients/settings.py +++ b/shelfmark/download/clients/settings.py @@ -1084,16 +1084,19 @@ def prowlarr_clients_settings() -> list[SettingsField]: default=0, min_value=0, max_value=240, - show_when={"field": "PROWLARR_TORRENT_CLIENT", "notEmpty": True}, + show_when={"field": "PROWLARR_TORRENT_CLIENT", "value": "qbittorrent"}, ), NumberField( key="TORRENT_MIN_SEEDERS", label="Minimum Seeders", - description="Seeds the client must see for a motionless torrent to keep waiting. 0 also turns the no-seed check off.", + description=( + "Seeds the client must see for a motionless torrent to keep waiting. 0 also " + "turns the no-seed check off. Only qBittorrent reports seed counts." + ), default=1, min_value=0, max_value=1000, - show_when={"field": "PROWLARR_TORRENT_CLIENT", "notEmpty": True}, + show_when={"field": "PROWLARR_TORRENT_CLIENT", "value": "qbittorrent"}, ), TextField( key="PROWLARR_TORRENT_POST_IMPORT_CATEGORY", diff --git a/tests/prowlarr/test_qbittorrent_settings.py b/tests/prowlarr/test_qbittorrent_settings.py index 436f90a2..8a2ef827 100644 --- a/tests/prowlarr/test_qbittorrent_settings.py +++ b/tests/prowlarr/test_qbittorrent_settings.py @@ -65,6 +65,18 @@ def test_api_key_field_is_registered(): assert field.show_when == {"field": "PROWLARR_TORRENT_CLIENT", "value": "qbittorrent"} +@pytest.mark.parametrize("key", ["TORRENT_NO_SEEDERS_WAIT", "TORRENT_MIN_SEEDERS"]) +def test_seed_settings_are_offered_for_qbittorrent_only(key): + """Only qBittorrent reports seed counts, so the other torrent clients ignore these (U7).""" + from shelfmark.download.clients.settings import prowlarr_clients_settings + + field = _get_field(prowlarr_clients_settings(), key) + + assert field is not None + assert field.show_when == {"field": "PROWLARR_TORRENT_CLIENT", "value": "qbittorrent"} + assert "qBittorrent" in field.description + + @pytest.mark.parametrize( ("api_key", "expected_kwarg", "expected_suffix"), [(API_KEY, API_KEY, " using the API key"), ("", None, "")],