feat(audiobookbay): seed time and ratio settings (#1503)

Closes #1037.

Two new AudiobookBay settings, Seed Time (minutes) and Seed Ratio. Both
default to 0, which leaves the torrent client's own limit as it is
today, so nothing changes until someone sets them.

They go to the client with the magnet the same way the Prowlarr seed
preferences do (`DownloadRequest.seeding_time_limit` and `ratio_limit`),
so they apply with the clients that already take per-torrent limits
there: qBittorrent, Transmission and Deluge. A retry that reuses the
saved magnet carries them too. A value that isn't a positive number
(text, negative, NaN, inf) is ignored and the client's limit stays.

Tests cover reading both settings (unset, zero, each on its own, text
values, bad values) and that both the fresh and the cached-magnet
request carry them. Ruff, basedpyright and the backend suite pass. I
haven't tried it against a live client, since the client side is the
code Prowlarr already uses.

I added the two entries to `docs/environment-variables.md` by hand.
Running `scripts/generate_env_docs.py` here also changes unrelated parts
of that file (the Soulseek table of contents link and the
`SHELFMARK_API_KEY_READONLY` entry), so I left those alone.
This commit is contained in:
splitsec2 authored and GitHub committed 2026-10-20 23:32:54 -04:00
1 parent 77b80eb31a
commit f2269aa201
4 files changed
+162

No files matched your search

+22
View File
@@ -1642,6 +1642,8 @@ Clear the transfer from slskd's download list after Shelfmark imports it. Applie
| `ABB_HOSTNAME` | AudiobookBay domain (e.g., audiobookbay.lu, audiobookbay.is). Required to enable searches. | string | _empty string_ |
| `ABB_PAGE_LIMIT` | Maximum number of search result pages to fetch (1-10). | number | `1` |
| `ABB_EXACT_PHRASE` | Wrap generated queries in quotes for stricter matching. If no results are found, Shelfmark retries without quotes. | boolean | `false` |
| `ABB_SEED_TIME_MINUTES` | How long a finished AudiobookBay torrent keeps seeding before the client stops it. 0 uses the torrent client's own limit. | number | `0` |
| `ABB_SEED_RATIO` | Share ratio an AudiobookBay torrent should reach before the client stops it. 0 uses the torrent client's own limit. | number | `0.0` |
| `ABB_RATE_LIMIT_DELAY` | Delay between requests in seconds to avoid rate limiting (0-10). | number | `1.0` |
<details>
@@ -1685,6 +1687,26 @@ Wrap generated queries in quotes for stricter matching. If no results are found,
- **Type:** boolean
- **Default:** `false`
#### `ABB_SEED_TIME_MINUTES`
**Seed Time (minutes)**
How long a finished AudiobookBay torrent keeps seeding before the client stops it. 0 uses the torrent client's own limit.
- **Type:** number
- **Default:** `0`
- **Constraints:** min: 0, max: 525600
#### `ABB_SEED_RATIO`
**Seed Ratio**
Share ratio an AudiobookBay torrent should reach before the client stops it. 0 uses the torrent client's own limit.
- **Type:** number
- **Default:** `0.0`
- **Constraints:** min: 0.0, max: 100.0
#### `ABB_RATE_LIMIT_DELAY`
**Rate Limit Delay (seconds)**