Skip to content

feat(exclusions): add Mdblist list exclusion support#232

Merged
rfsbraz merged 2 commits intomainfrom
feat/mdblist-exclusions
Feb 23, 2026
Merged

feat(exclusions): add Mdblist list exclusion support#232
rfsbraz merged 2 commits intomainfrom
feat/mdblist-exclusions

Conversation

@rfsbraz
Copy link
Copy Markdown
Owner

@rfsbraz rfsbraz commented Feb 20, 2026

Closes #226

Adds Mdblist as an exclusion provider, allowing users to protect media that appears on Mdblist lists from deletion. Follows the same pattern as the existing Trakt list exclusion.

Configuration

Global (API credentials)

mdblist:
  api_key: YOUR_MDBLIST_API_KEY  # from https://mdblist.com/preferences/

Per-library exclusion

libraries:
  Movies:
    radarr:
      url: http://localhost:7878
      api_key: YOUR_RADARR_API_KEY
    exclusions:
      mdblist:
        max_items_per_list: 1000  # optional, default 1000
        lists:
          - https://mdblist.com/lists/username/listname

Movies are matched by TMDB ID, shows by TVDB ID — same as Trakt exclusions.

Testing

@RandomNinjaAtk — we don't use Mdblist ourselves, so we'd appreciate if you could try the Docker image generated from this PR and let us know if it works as expected. 🙏

Changes

  • New app/modules/mdblist.py — API client with pagination support
  • Schema additions in app/schema.pyMdblistConfig and MdblistExclusions models
  • Wired into app/media_cleaner.py processing pipeline
  • Updated scripts/generate_docs.py for documentation generation
  • 23 new unit tests in tests/modules/test_mdblist.py

@github-actions
Copy link
Copy Markdown
Contributor

🐳 A Docker image for this PR will be available after the build completes:

docker run -e LOG_LEVEL=DEBUG --rm \
  -v ./config:/config \
  -v ./logs:/config/logs \
  ghcr.io/rfsbraz/deleterr:pr-232

Note: This image is built for linux/amd64 only. The image is pushed to GHCR (not Docker Hub) for PR testing.

@rfsbraz rfsbraz self-assigned this Feb 20, 2026
@RandomNinjaAtk
Copy link
Copy Markdown

Is there a Image tag to use to give this a test?
Currently using the "latest" tag.

@rfsbraz
Copy link
Copy Markdown
Owner Author

rfsbraz commented Feb 20, 2026

Is there a Image tag to use to give this a test? Currently using the "latest" tag.

Yes! ghcr.io/rfsbraz/deleterr:pr-232

@RandomNinjaAtk
Copy link
Copy Markdown

RandomNinjaAtk commented Feb 20, 2026

@rfsbraz

Updated to the new image, added the new options to the config, and this is what I get in the log as an error that wasn't happening previously:

2026-02-20 13:32:43 - INFO    :: deleterr.py :: deleterr : Starting in scheduler mode
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : Using schedule preset 'hourly' (0 * * * *)
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : Deleterr scheduler started
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : Schedule: hourly
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : Timezone: America/New_York
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : run_on_startup enabled, executing initial run...
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : ============================================================
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : Scheduled run starting at 2026-02-20T13:32:43.782837
2026-02-20 13:32:43 - INFO    :: scheduler.py :: deleterr : ============================================================
2026-02-20 13:32:43 - INFO    :: deleterr.py :: deleterr : Processing radarr instance: 'Radarr'
2026-02-20 13:32:43 - INFO    :: deleterr.py :: deleterr : [1/1] Processing library 'Movies'
2026-02-20 13:32:43 - INFO    :: media_cleaner.py :: deleterr : Plex library loaded (1902 items)
2026-02-20 13:32:44 - ERROR   :: scheduler.py :: deleterr : Scheduled run failed: 'str' object has no attribute 'get'

It was working previously...

EDIT:

So after a bit of further testing, I disabled the exclusion by commenting it out for mdblist and it did run normally under this PR image...

For reference this is what I added to my settings.yaml:

mdblist:
  api_key: <API-KEY>  # from https://mdblist.com/preferences/

libraries:
  - name: "Movies"
    radarr: "Radarr"
    action_mode: "delete"
    last_watched_threshold: 365
    added_at_threshold: 30
    max_actions_per_run: 1000
    preview_next: 1000
    sort:
      field: "rating"
      order: "asc"  # Delete lowest rated first
    exclude:
      radarr:
        tags: ["automation"]
      mdblist:
        max_items_per_list: 1000  # optional, default 1000
        lists:
          - https://mdblist.com/lists/hdlists/top-ten-pirated-movies-of-the-week-torrent-freak-com

@rfsbraz
Copy link
Copy Markdown
Owner Author

rfsbraz commented Feb 20, 2026

@RandomNinjaAtk thank you for taking the time, seems like the mdblist integration is working then. I'll check what the other error was and merge this into a new release!

The mdblist API returns {"movies": [...], "shows": [...]} but the code
assumed a bare JSON array, causing 'str' object has no attribute 'get'
when extending a list with dict keys. Also fixed field names to match
the actual API (id, tvdb_id) instead of non-existent tmdbid/tvdbid.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@RandomNinjaAtk
Copy link
Copy Markdown

@RandomNinjaAtk thank you for taking the time, seems like the mdblist integration is working then. I'll check what the other error was and merge this into a new release!

I wouldn't say it worked because with the exclude enabled for mdblist, I get the above error. It only runs normally without mdblist exclusion enabled on the PR build... Sounds confusing I know... Hope that helps

@rfsbraz
Copy link
Copy Markdown
Owner Author

rfsbraz commented Feb 22, 2026

@RandomNinjaAtk thank you for taking the time, seems like the mdblist integration is working then. I'll check what the other error was and merge this into a new release!

I wouldn't say it worked because with the exclude enabled for mdblist, I get the above error. It only runs normally without mdblist exclusion enabled on the PR build... Sounds confusing I know... Hope that helps

You're right I misunderstood your message. It is fixed now, and working.

@rfsbraz rfsbraz merged commit d3f5f62 into main Feb 23, 2026
8 of 9 checks passed
@rfsbraz rfsbraz deleted the feat/mdblist-exclusions branch March 10, 2026 20:08
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.

Feature Request: Add support for Mdblist for exclude feature/function

2 participants