Skip to content

feat: add AllDebrid slot management strategies#199

Open
buzzromain wants to merge 1 commit into
sirrobot01:betafrom
buzzromain:feat/alldebrid-slot-management
Open

feat: add AllDebrid slot management strategies#199
buzzromain wants to merge 1 commit into
sirrobot01:betafrom
buzzromain:feat/alldebrid-slot-management

Conversation

@buzzromain
Copy link
Copy Markdown

@buzzromain buzzromain commented Feb 12, 2026

Summary

AllDebrid has a ~1000 torrent slot limit. This PR adds two configurable strategies to manage slots automatically via the slot_strategy config field (AllDebrid only):

  • remove_after_add: Removes the torrent from AllDebrid immediately after it's been downloaded/processed, freeing the slot. Links remain functional via /link/unlock.
  • remove_oldest: Before adding a new torrent, removes the oldest magnet if the configured limit is reached.

Torrents removed by a slot strategy are marked with RemovedAt so they are not treated as unexpected deletions by detectTorrentChanges. If a torrent reappears on the remote (e.g. re-added by Fixer),
RemovedAt is cleared.

Changes

  • internal/config/debrid.goslot_strategy field + validation (alldebrid only)
  • pkg/debrid/providers/alldebrid/alldebrid.gocountMagnets(), enforceSlotLimit(), updated GetAvailableSlots() and SubmitMagnet()
  • pkg/manager/processor.goapplySlotStrategy() for remove_after_add
  • pkg/manager/torrent.godetectTorrentChanges() respects RemovedAt
  • pkg/server/assets/js/config.js — UI dropdown (visible only for alldebrid)
  • Docs updated

Configuration example

{
  "debrids": [
    {
      "provider": "alldebrid",
      "api_key": "...",
      "slot_strategy": "remove_after_add",
      "limit": 1000
    }
  ]
}

Closes #196

@ioeldev
Copy link
Copy Markdown
Contributor

ioeldev commented Mar 14, 2026

can we Merge this ? it would be very helpful for AllDebrid users

@sirrobot01
Copy link
Copy Markdown
Owner

Can you fix the conflicts? This is an interesting PR that might help a lot for AD users

@ioeldev
Copy link
Copy Markdown
Contributor

ioeldev commented Apr 10, 2026

note that i was able to cap my AD with 5000 magnets, not 1000, using decypharr

@buzzromain buzzromain force-pushed the feat/alldebrid-slot-management branch from 8cedd23 to 1c3273e Compare April 11, 2026 08:26
@buzzromain
Copy link
Copy Markdown
Author

buzzromain commented Apr 11, 2026

note that i was able to cap my AD with 5000 magnets, not 1000, using decypharr

Yes, you’re right. I ran some tests using a script that uploads thousands of magnets to Alldebrid in batches of 100, and based on my testing, the supposed limit of 1,000 magnets doesn’t actually seem to be enforced. A few weeks ago, however, I was still capped at 1,000 magnets on Alldebrid during my tests.

I currently have 5,041 magnets on my Alldebrid account. I believe I was able to reach that number (≥ 5,000 magnets) because I uploaded them in batches of 100, and their API doesn’t check the total number of torrents being added per request (endpoint POST /v4/magnet/upload).

The limit is still documented as 1,000 torrents in their API and in the API responses. They likely introduced this “limit” because pagination isn’t implemented on their magnet listing endpoint.

So in practice, the limit seems to be around 5,000 torrents on Alldebrid.

@ioeldev
Copy link
Copy Markdown
Contributor

ioeldev commented Apr 11, 2026

note that i was able to cap my AD with 5000 magnets, not 1000, using decypharr

Yes, you’re right. I ran some tests using a script that uploads thousands of magnets to Alldebrid in batches of 100, and based on my testing, the supposed limit of 1,000 magnets doesn’t actually seem to be enforced. A few weeks ago, however, I was still capped at 1,000 magnets on Alldebrid during my tests.

I currently have 5,041 magnets on my Alldebrid account. I believe I was able to reach that number (≥ 5,000 magnets) because I uploaded them in batches of 100, and their API doesn’t check the total number of torrents being added per request (endpoint POST /v4/magnet/upload).

The limit is still documented as 1,000 torrents in their API and in the API responses. They likely introduced this “limit” because pagination isn’t implemented on their magnet listing endpoint.

So in practice, the limit seems to be around 5,000 torrents on Alldebrid.

It seems that they increased their limit without updating the docs yet.
Anyway, I suppose there will still be a cap somewhere so having the feature you suggested is still worth it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants