mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 12:50:09 +00:00
Add per-indexer ratio-based seeding policy
Introduce a per-indexer ratioLimit alongside seedingTimeMinutes to control torrent cleanup. Updates include: documentation (scheduler and settings pages), types and API (saved indexer config now includes ratioLimit), setup and management UI (new TorrentSeedingFields component, modal wiring, validation and handlers), and processor logic (cleanup-seeded-torrents now requires AND-semantics between time and ratio; 0 disables a criterion, both 0 = never cleaned, undefined client ratio with ratioLimit>0 = not met). Tests were added/updated to cover ratio-only, time+ratio, missing-ratio, and UI interactions. Default behavior: ratioLimit defaults to 0 (no ratio requirement).
This commit is contained in:
@@ -24,7 +24,7 @@ describe('IndexerConfigModal', () => {
|
||||
/>
|
||||
);
|
||||
|
||||
const [priorityInput, seedingInput] = screen.getAllByRole('spinbutton');
|
||||
const [priorityInput, seedingInput, ratioInput] = screen.getAllByRole('spinbutton');
|
||||
|
||||
fireEvent.change(priorityInput, { target: { value: '99' } });
|
||||
expect(priorityInput).toHaveValue(25);
|
||||
@@ -32,6 +32,12 @@ describe('IndexerConfigModal', () => {
|
||||
fireEvent.change(seedingInput, { target: { value: '-5' } });
|
||||
expect(seedingInput).toHaveValue(0);
|
||||
|
||||
fireEvent.change(ratioInput, { target: { value: '-0.5' } });
|
||||
expect(ratioInput).toHaveValue(0);
|
||||
|
||||
fireEvent.change(ratioInput, { target: { value: '1.5' } });
|
||||
expect(ratioInput).toHaveValue(1.5);
|
||||
|
||||
const rssToggle = screen.getByRole('checkbox');
|
||||
fireEvent.click(rssToggle);
|
||||
|
||||
@@ -43,6 +49,7 @@ describe('IndexerConfigModal', () => {
|
||||
name: 'Prowlarr',
|
||||
priority: 25,
|
||||
seedingTimeMinutes: 0,
|
||||
ratioLimit: 1.5,
|
||||
rssEnabled: false,
|
||||
audiobookCategories: expect.arrayContaining([3030]),
|
||||
ebookCategories: expect.arrayContaining([7020]),
|
||||
|
||||
Reference in New Issue
Block a user