### Full MDBList Configuration Example Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/mdblist.md A comprehensive example demonstrating global API key setup and library-specific exclusion rules, including advanced options like `max_items_per_list`. ```yaml mdblist: api_key: "YOUR_MDBLIST_API_KEY" libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: mdblist: max_items_per_list: 2000 lists: - "https://mdblist.com/lists/linaspuransen/top-250-movies" - "https://mdblist.com/lists/hdlists/top-ten-pirated-movies-of-the-week" - name: "TV Shows" sonarr: "Sonarr" series_type: "standard" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: mdblist: lists: - "https://mdblist.com/lists/garycrawfordgc/top-rated-tv" ``` -------------------------------- ### Copy Example Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Copy the example settings file to create your own configuration file. Ensure sensitive data is removed before committing. ```bash cp config/settings.yaml.example config/settings.yaml ``` -------------------------------- ### Full Trakt Integration Example Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/trakt.md A comprehensive configuration example demonstrating global Trakt credentials and library-specific exclusions for both movies and TV shows, including custom list URLs and `max_items_per_list`. ```yaml trakt: client_id: "YOUR_TRAKT_CLIENT_ID" client_secret: "YOUR_TRAKT_CLIENT_SECRET" libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: trakt: max_items_per_list: 200 lists: - "https://trakt.tv/movies/trending" - "https://trakt.tv/movies/popular" - "https://trakt.tv/users/justin/lists/imdb-top-rated-movies" - name: "TV Shows" sonarr: "Sonarr" series_type: "standard" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: trakt: lists: - "https://trakt.tv/shows/trending" - "https://trakt.tv/shows/popular" ``` -------------------------------- ### Deleterr Configuration File Example Source: https://github.com/rfsbraz/deleterr/blob/main/docs/getting-started.md Create a `config/settings.yaml` file to configure Deleterr. It's recommended to start with `dry_run` enabled to preview deletions. This example includes settings for Plex, optional Tautulli, Radarr, and library configurations. ```yaml dry_run: true # Preview changes without deleting plex: url: "http://plex:32400" token: "YOUR_PLEX_TOKEN" # Tautulli is optional - if not configured, Plex API is used for watch history tautulli: url: "http://tautulli:8181" api_key: "YOUR_TAUTULLI_API_KEY" radarr: - name: "Radarr" url: "http://radarr:7878" api_key: "YOUR_RADARR_API_KEY" libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Install the main project dependencies and development-specific dependencies using pip. ```bash pip install -r requirements.txt pip install -r requirements-dev.txt ``` -------------------------------- ### Start Docker Services for Integration Tests Source: https://github.com/rfsbraz/deleterr/blob/main/tests/integration/README.md Change to the integration tests directory and start the Docker services defined in the integration compose file. Use the --build flag to ensure images are built. ```bash cd tests/integration docker-compose -f docker-compose.integration.yml up -d --build ``` -------------------------------- ### Deleterr Configuration File Example Source: https://context7.com/rfsbraz/deleterr/llms.txt A comprehensive example of the `settings.yaml` file. Configure connections to Plex, multiple Radarr and Sonarr instances, Tautulli, and Trakt. Global settings like `dry_run`, `ssl_verify`, and `action_delay` are also included, along with scheduler options. ```yaml # /config/settings.yaml - Complete configuration example # Plex connection plex: url: "http://localhost:32400" token: "YOUR_PLEX_TOKEN" # Radarr instances (supports multiple) radarr: - name: "Radarr" url: "http://localhost:7878" api_key: "YOUR_RADARR_API_KEY" - name: "Radarr 4K" url: "http://localhost:7879" api_key: "YOUR_RADARR_4K_API_KEY" # Sonarr instances (supports multiple) sonarr: - name: "Sonarr" url: "http://localhost:8989" api_key: "YOUR_SONARR_API_KEY" - name: "Sonarr 4K" url: "http://localhost:8990" api_key: "YOUR_SONARR_4K_API_KEY" # Tautulli for watch history (optional, falls back to Plex API) tautulli: url: "http://localhost:8181" api_key: "YOUR_TAUTULLI_API_KEY" # Trakt for exclusion lists trakt: client_id: "YOUR_TRAKT_CLIENT_ID" client_secret: "YOUR_TRAKT_CLIENT_SECRET" # Global settings dry_run: true # Set to false to enable actual deletions ssl_verify: false action_delay: 25 # Seconds between actions to prevent overload # Scheduler configuration scheduler: enabled: true schedule: "weekly" # Options: hourly, daily, weekly, monthly, or cron "0 3 * * 0" timezone: "America/New_York" run_on_startup: false ``` -------------------------------- ### Full Deleterr Configuration Example Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/multi-instance.md A comprehensive configuration demonstrating multi-instance support for Radarr and Sonarr, including Plex and Tautulli integration, and specific settings for different library tiers like standard and 4K. This example includes dry_run enabled. ```yaml dry_run: true plex: url: "http://localhost:32400" token: "YOUR_PLEX_TOKEN" tautulli: url: "http://localhost:8181" api_key: "YOUR_TAUTULLI_API_KEY" radarr: - name: "Radarr" url: "http://localhost:7878" api_key: "YOUR_RADARR_API_KEY" - name: "Radarr 4K" url: "http://localhost:7879" api_key: "YOUR_RADARR_4K_API_KEY" sonarr: - name: "Sonarr" url: "http://localhost:8989" api_key: "YOUR_SONARR_API_KEY" - name: "Sonarr 4K" url: "http://localhost:8990" api_key: "YOUR_SONARR_4K_API_KEY" libraries: # Standard quality - more aggressive cleanup - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 60 added_at_threshold: 90 max_actions_per_run: 50 # 4K - conservative cleanup - name: "Movies 4K" radarr: "Radarr 4K" action_mode: "delete" last_watched_threshold: 180 added_at_threshold: 365 max_actions_per_run: 10 exclude: radarr: tags: ["keep", "favorite"] - name: "TV Shows" sonarr: "Sonarr" series_type: "standard" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 - name: "TV Shows 4K" sonarr: "Sonarr 4K" series_type: "standard" action_mode: "delete" last_watched_threshold: 365 added_at_threshold: 365 max_actions_per_run: 5 ``` -------------------------------- ### Start Docker Compose Stack Source: https://github.com/rfsbraz/deleterr/blob/main/docs/getting-started.md This command starts all services defined in your `docker-compose.yaml` file in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Docker Compose for Deleterr Source: https://github.com/rfsbraz/deleterr/blob/main/README.md Example Docker Compose configuration for deploying Deleterr. This setup includes a weekly schedule by default. ```yaml services: deleterr: image: ghcr.io/rfsbraz/deleterr:latest container_name: deleterr environment: LOG_LEVEL: INFO volumes: - ./config:/config restart: unless-stopped ``` -------------------------------- ### Basic Library Configuration with Exclusions Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/exclusions.md This is a basic example of how to configure a library block with exclusion rules. All exclusions are configured under the 'exclude' key within a library block. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" exclude: # Your exclusion rules here ``` -------------------------------- ### Full Deleterr Configuration with JustWatch Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/justwatch.md An example demonstrating a complete Deleterr configuration, including global JustWatch settings and two libraries with different JustWatch exclusion strategies. ```yaml justwatch: country: "US" language: "en" libraries: # Main library: keep movies not available anywhere - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: justwatch: not_available_on: ["any"] # Streaming copies: more aggressive for content on your services - name: "Streaming Copies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 30 added_at_threshold: 90 max_actions_per_run: 50 exclude: justwatch: available_on: ["netflix", "disneyplus", "amazon", "hbomax", "hulu"] ``` -------------------------------- ### Configure Leaving Soon with Labels Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/leaving-soon.md Configure 'leaving_soon' to apply labels instead of or in addition to Plex collections. This example sets a 7-day duration and applies a label named 'leaving-soon'. ```yaml leaving_soon: duration: "7d" collection: name: "Leaving Soon" labels: name: "leaving-soon" ``` -------------------------------- ### Configure Leaving Soon Email Notifications Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/leaving-soon.md Set up email notifications for the 'leaving_soon' feature. This example configures Gmail SMTP settings, including sender and recipient addresses. ```yaml notifications: leaving_soon: subject: "Content leaving your Plex server soon!" email: smtp_server: "smtp.gmail.com" smtp_port: 587 smtp_username: !env SMTP_USERNAME smtp_password: !env SMTP_PASSWORD use_tls: true from_address: "plex@yourdomain.com" to_addresses: - "user1@example.com" - "user2@example.com" ``` -------------------------------- ### Full Deleterr Configuration Example Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/overseerr.md This configuration sets up Deleterr to manage deletion of movies and TV shows. It includes Seerr integration for exclusion rules based on watch status and request data. ```yaml seerr: url: "http://localhost:5055" api_key: "YOUR_SEERR_API_KEY" libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: seerr: mode: "exclude" include_pending: true request_status: ["approved", "pending"] update_status: true - name: "TV Shows" sonarr: "Sonarr" series_type: "standard" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: seerr: mode: "exclude" users: ["admin"] min_request_age_days: 60 update_status: true ``` -------------------------------- ### Docker Development Commands Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Build and run the Deleterr application using Docker. 'make build' builds the image, 'make run' builds and starts services, and 'make clean' stops and removes containers. ```bash make build # Build Docker image with git metadata make run # Build and run with docker-compose make clean # Stop and remove containers ``` -------------------------------- ### Run Integration Tests in Deleterr Source: https://github.com/rfsbraz/deleterr/blob/main/CLAUDE.md Execute integration tests using Docker Compose. This requires Docker to be installed and running. Tests are run with a timeout of 300 seconds. ```bash cd tests/integration docker compose -f docker-compose.integration.yml up -d pytest tests/integration/ -m integration -v --timeout=300 docker compose -f docker-compose.integration.yml down -v ``` -------------------------------- ### Configure Leaving Soon Section in Libraries Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/leaving-soon.md Add the 'leaving_soon' section to your library configuration to enable the feature. This example sets a batch size of 10 and a duration of 7 days, creating a Plex collection named 'Leaving Soon'. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" leaving_soon: batch_size: 10 duration: "7d" collection: name: "Leaving Soon" ``` -------------------------------- ### Docker Compose Configuration for Deleterr Source: https://context7.com/rfsbraz/deleterr/llms.txt Set up Deleterr service in docker-compose.yml, mapping environment variables and mounting a configuration volume. This example shows how to define the Deleterr service and its required environment variables. ```yaml services: deleterr: image: ghcr.io/rfsbraz/deleterr:latest environment: PLEX_URL: "http://plex:32400" PLEX_TOKEN: "your-plex-token" RADARR_URL: "http://radarr:7878" RADARR_API_KEY: "your-radarr-key" SMTP_USERNAME: "your-email@gmail.com" SMTP_PASSWORD: "your-app-password" volumes: - ./config:/config ``` -------------------------------- ### Enable Dry Run Mode Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Set `dry_run: true` to simulate deletions without actually removing any files. Always start with this option. ```yaml dry_run: true ``` -------------------------------- ### Multi-Level Sorting Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/sorting.md Define multiple fields for sorting to break ties. This example sorts primarily by `last_watched` and secondarily by `size`, both in descending order. ```yaml sort: field: "last_watched,size" order: "desc,desc" ``` -------------------------------- ### Deleterr Settings for Custom Cron Schedule Source: https://github.com/rfsbraz/deleterr/blob/main/docs/getting-started.md Configure the built-in scheduler with a custom cron expression and timezone. `run_on_startup: true` will execute the cleanup when the container starts. ```yaml scheduler: enabled: true schedule: "0 4 * * 1,4" # Monday and Thursday at 4am timezone: "Europe/London" run_on_startup: true # Also run when container starts ``` -------------------------------- ### Deleterr Schedule Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/README.md YAML snippet showing how to configure the cron schedule for Deleterr's built-in scheduler. Examples for daily and specific day/time runs are provided. ```yaml schedule: cron: "0 0 * * 0" # Every Sunday at midnight (default) # cron: "0 3 * * *" # Daily at 3 AM # cron: "0 0 * * 0,3" # Sundays and Wednesdays at midnight ``` -------------------------------- ### Configure Library Deletion Sorting Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/sorting.md Set the sorting field and order for deletions within a specific library. This example sorts by size in descending order, deleting the largest files first. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" max_actions_per_run: 20 sort: field: "size" order: "desc" # Largest first ``` -------------------------------- ### Minimal Movies Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/docs/templates.md A basic single-library setup for deleting movies watched more than 90 days ago, provided they were added more than 180 days ago. Limits deletions to 10 per run. Set `dry_run: false` to enable deletions. ```yaml dry_run: true plex: url: "http://localhost:32400" token: "YOUR_PLEX_TOKEN" tautulli: url: "http://localhost:8181" api_key: "YOUR_TAUTULLI_API_KEY" radarr: - name: "Radarr" url: "http://localhost:7878" api_key: "YOUR_RADARR_API_KEY" libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 10 ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Create a Python virtual environment and activate it for local development. The activation command differs for Windows. ```bash python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate ``` -------------------------------- ### Conventional Commit Message Structure Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Examples of conventional commit messages using prefixes like 'feat:', 'fix:', 'docs:' and optional scopes. ```git feat(notifications): add Telegram notification support fix(radarr): handle timeout on large libraries test(integration): add Sonarr season deletion test refactor(config): simplify schema validation logic ``` -------------------------------- ### Manual Docker Build and Run Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Manually build the Docker image for Deleterr and run it, mounting the config directory. ```bash docker build -t deleterr:dev . docker run -v $(pwd)/config:/config deleterr:dev ``` -------------------------------- ### Docker CLI Run Command Source: https://github.com/rfsbraz/deleterr/blob/main/README.md Command to run Deleterr using the Docker CLI, mounting a local config directory. This command starts the scheduler. ```bash docker run -v ./config:/config ghcr.io/rfsbraz/deleterr:latest ``` -------------------------------- ### Generate Tautulli Database Source: https://github.com/rfsbraz/deleterr/blob/main/tests/integration/README.md Navigate to the Tautulli seed data directory and execute the Python script to create the test database. ```bash cd tests/integration/seed_data/tautulli python create_db.py ``` -------------------------------- ### Portainer Manual Directory Creation Source: https://github.com/rfsbraz/deleterr/blob/main/docs/getting-started.md If using Portainer and encountering bind mount errors, manually create the necessary directories on the host machine before configuring your stack. ```bash mkdir -p /path/to/deleterr/config mkdir -p /path/to/deleterr/logs ``` -------------------------------- ### Regenerate Documentation Source: https://github.com/rfsbraz/deleterr/blob/main/CLAUDE.md Update the configuration documentation by running this script. This is necessary after modifying the configuration schema in `app/schema.py`. ```bash python -m scripts.generate_docs ``` -------------------------------- ### Exclude Trakt Lists from Library Actions Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/trakt.md Specify Trakt lists to exclude from deletion actions within your library configuration. This example shows exclusion for a 'Movies' library. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" exclude: trakt: lists: - "https://trakt.tv/movies/trending" - "https://trakt.tv/movies/popular" ``` -------------------------------- ### Configure Disk Thresholds with Leaving Soon Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/leaving-soon.md Use this configuration to tag items for deletion only when disk space is low. Ensure 'batch_size' or 'preview_next' is greater than 0 for collection creation. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" disk_size_threshold: - path: "/data/media" threshold: 500GB leaving_soon: batch_size: 10 collection: name: "Leaving Soon" ``` -------------------------------- ### Docker Compose for External Scheduler (Ofelia) Source: https://github.com/rfsbraz/deleterr/blob/main/docs/getting-started.md This Docker Compose setup integrates Deleterr with Ofelia for advanced scheduling control. Ofelia requires access to the Docker socket. ```yaml version: "3.9" services: deleterr: image: ghcr.io/rfsbraz/deleterr:latest container_name: deleterr environment: LOG_LEVEL: INFO volumes: - ./config:/config - ./logs:/config/logs restart: no scheduler: image: mcuadros/ofelia:latest container_name: scheduler depends_on: - deleterr command: daemon --docker volumes: - /var/run/docker.sock:/var/run/docker.sock:ro restart: unless-stopped labels: ofelia.job-run.deleterr.schedule: "@weekly" ofelia.job-run.deleterr.container: "deleterr" ``` -------------------------------- ### Configure Plex URL Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Ensure the Plex URL includes the protocol and port for successful connection. ```yaml plex: url: "http://192.168.1.100:32400" # Not just "192.168.1.100" ``` -------------------------------- ### Multi-Level Sorting with Reused Order Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/sorting.md When fewer orders are specified than fields, the last order is applied to all subsequent fields. This example sorts `last_watched`, `size`, and `title` all in descending order. ```yaml sort: field: "last_watched,size,title" order: "desc" # All three fields sort descending ``` -------------------------------- ### List Plex Libraries Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Use `curl` to list available Plex libraries and their titles, useful for verifying library names. ```bash # List Plex libraries curl -H "X-Plex-Token: YOUR_TOKEN" \ http://plex:32400/library/sections | grep title ``` -------------------------------- ### Run Deleterr Manually for Verification Source: https://github.com/rfsbraz/deleterr/blob/main/docs/getting-started.md Execute this command to run Deleterr once manually. This is useful for verifying your setup and configuration before enabling automatic runs or disabling the dry run mode. ```bash docker compose run --rm deleterr ``` -------------------------------- ### Configure Disk Size Threshold Path Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Specify the container path for `disk_size_threshold` to monitor disk space accurately. ```yaml disk_size_threshold: - path: "/data/media" # Container path, not host path threshold: "500GB" ``` -------------------------------- ### Run Deleterr Tests Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Execute the test suite using make commands. Use 'make test' for all tests with coverage, 'make unit' for unit tests only, and 'make integration' for integration tests. ```bash make test # All tests with coverage make unit # Unit tests only (excludes integration and slow) make integration # Integration tests only ``` -------------------------------- ### Configure User Notifications (Leaving Soon) Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/notifications.md Set up email notifications for users about content scheduled for deletion. This configuration is separate from admin notifications and requires its own SMTP settings. ```yaml notifications: leaving_soon: subject: "Content leaving your Plex server soon!" email: smtp_server: "smtp.gmail.com" smtp_port: 587 smtp_username: !env SMTP_USERNAME smtp_password: !env SMTP_PASSWORD use_tls: true from_address: "plex@yourdomain.com" to_addresses: - "family@example.com" - "friends@example.com" ``` -------------------------------- ### Combine Disk Thresholds with Size Sorting Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/disk-thresholds.md Integrate disk size thresholds with size-based sorting to prioritize deleting the largest files first when disk space is low. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" max_actions_per_run: 50 disk_size_threshold: - path: "/data/media" threshold: "500GB" sort: field: "size" order: "desc" # Delete largest files first ``` -------------------------------- ### Configure Seerr API Credentials Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Provide the correct URL and API key for Seerr integration. The API key is found in Seerr's Settings > General. ```yaml seerr: url: "http://localhost:5055" api_key: "YOUR_API_KEY" # From Seerr Settings > General ``` -------------------------------- ### Validate Settings YAML Syntax Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Use Python with PyYAML to validate the syntax of your `settings.yaml` file before running the container. ```bash docker run --rm -v ./config:/config deleterr \ python -c "import yaml; yaml.safe_load(open('/config/settings.yaml'))" ``` -------------------------------- ### Run Deleterr Docker Container Source: https://context7.com/rfsbraz/deleterr/llms.txt Commands to run the Deleterr Docker container. The first command starts the container with the built-in scheduler enabled. The second command runs the container once and exits, suitable for external schedulers. The third command runs in dry-run mode to preview actions without making changes. ```bash # Run with built-in scheduler (default - runs weekly on Sundays) docker compose up -d ``` ```bash # Run once and exit (for external schedulers like cron) docker run -v ./config:/config ghcr.io/rfsbraz/deleterr:latest --run-once ``` ```bash # Run in dry-run mode (logs what would happen, no changes) # Set dry_run: true in settings.yaml docker run -v ./config:/config ghcr.io/rfsbraz/deleterr:latest --run-once ``` -------------------------------- ### Set Container User Permissions Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Adjust ownership of config and log directories to match the container's default UID (1000) using `chown`. ```bash sudo chown -R 1000:1000 ./config ./logs ``` -------------------------------- ### Sort by Oldest Content First Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/sorting.md Delete media that was released the longest time ago. This strategy helps in clearing out older content from the library. ```yaml sort: field: "release_year" order: "asc" ``` -------------------------------- ### Configure Disk Size Threshold for a Library Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/disk-thresholds.md Set a disk size threshold for a specific library. If free space on the configured path is above this threshold, the library will be skipped for deletion. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" disk_size_threshold: - path: "/data/media" threshold: "500GB" ``` -------------------------------- ### Disk Space Thresholds for Cleanup Source: https://context7.com/rfsbraz/deleterr/llms.txt Define disk space thresholds for triggering cleanup actions. Specify paths and their corresponding minimum free space requirements. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" disk_size_threshold: # Path must match a root folder in Radarr/Sonarr - path: "/data/media/movies" threshold: 500GB - path: "/data/media/movies-4k" threshold: 1TB - name: "TV Shows" sonarr: "Sonarr" action_mode: "delete" disk_size_threshold: - path: "/data/media/tv" threshold: 2TB ``` -------------------------------- ### Configure Disk Threshold Format Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Use quotes for threshold values with units (e.g., '500GB') to avoid potential parsing issues. ```yaml threshold: "500GB" # Correct threshold: 500GB # May cause issues threshold: "500" # Assumes bytes ``` -------------------------------- ### Add Global Seerr Connection Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/overseerr.md Configure the connection details for your Seerr or Overseerr instance. Ensure you replace 'YOUR_SEERR_API_KEY' with your actual API key. ```yaml seerr: url: "http://localhost:5055" api_key: "YOUR_SEERR_API_KEY" ``` -------------------------------- ### Test Seerr API Connection Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Use 'curl' to test the connection to the Seerr API and verify authentication. Replace 'YOUR_KEY' with your actual Seerr API key. ```bash curl -H "X-Api-Key: YOUR_KEY" http://seerr:5055/api/v1/status ``` -------------------------------- ### 4K Multi-Instance Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/docs/templates.md Manages multiple libraries (standard and 4K movies, standard TV shows) with distinct retention policies. 4K content uses longer thresholds and lower deletion limits. Set `dry_run: false` to enable deletions. ```yaml dry_run: true plex: url: "http://localhost:32400" token: "YOUR_PLEX_TOKEN" tautulli: url: "http://localhost:8181" api_key: "YOUR_TAUTULLI_API_KEY" radarr: - name: "Radarr" url: "http://localhost:7878" api_key: "YOUR_RADARR_API_KEY" - name: "Radarr 4K" url: "http://localhost:7879" api_key: "YOUR_RADARR_4K_API_KEY" sonarr: - name: "Sonarr" url: "http://localhost:8989" api_key: "YOUR_SONARR_API_KEY" - name: "Sonarr 4K" url: "http://localhost:8990" api_key: "YOUR_SONARR_4K_API_KEY" libraries: # Standard quality - more aggressive - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 60 added_at_threshold: 90 max_actions_per_run: 50 # 4K - more conservative - name: "Movies 4K" radarr: "Radarr 4K" action_mode: "delete" last_watched_threshold: 180 added_at_threshold: 365 max_actions_per_run: 10 - name: "TV Shows" sonarr: "Sonarr" series_type: "standard" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 - name: "TV Shows 4K" sonarr: "Sonarr 4K" series_type: "standard" action_mode: "delete" last_watched_threshold: 365 added_at_threshold: 365 max_actions_per_run: 5 ``` -------------------------------- ### Configure Multiple Disk Threshold Paths Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/disk-thresholds.md Specify multiple paths for disk space checking. Deletion will only proceed if all specified paths are below their respective thresholds. ```yaml disk_size_threshold: - path: "/data/movies" threshold: "200GB" - path: "/data/tv" threshold: "300GB" ``` -------------------------------- ### Run Unit Tests in Deleterr Source: https://github.com/rfsbraz/deleterr/blob/main/CLAUDE.md Execute unit tests quickly without requiring Docker. Use this for rapid feedback during development. ```bash pytest -m "not integration and not slow" -v ``` -------------------------------- ### Migrating Overseerr to Seerr Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/overseerr.md Demonstrates the migration from the deprecated 'overseerr' configuration key to the recommended 'seerr' key. This change applies to both global Seerr settings and library-level exclusions. ```yaml # Before (still works, but deprecated) overseerr: url: "http://localhost:5055" api_key: "YOUR_API_KEY" # After (recommended) seerr: url: "http://localhost:5055" api_key: "YOUR_API_KEY" ``` ```yaml # Before (still works, but deprecated) exclude: overseerr: mode: "exclude" users: ["admin"] min_request_age_days: 60 update_status: true # After (recommended) exclude: seerr: mode: "exclude" users: ["admin"] min_request_age_days: 60 update_status: true ``` -------------------------------- ### Clone Deleterr Repository Source: https://github.com/rfsbraz/deleterr/blob/main/CONTRIBUTING.md Clone your forked repository and navigate into the project directory. ```bash git clone https://github.com/YOUR_USERNAME/deleterr.git cd deleterr ``` -------------------------------- ### Reference Instances in Library Blocks Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/multi-instance.md Associate library configurations with specific Radarr or Sonarr instances by using the 'name' defined in the top-level instance definitions. The library 'name' must match the Plex library name exactly. ```yaml libraries: - name: "Movies" radarr: "Radarr" # References the instance named "Radarr" action_mode: "delete" # ... - name: "Movies 4K" radarr: "Radarr 4K" # References the instance named "Radarr 4K" action_mode: "delete" # ... ``` -------------------------------- ### Configure Discord Admin Notifications Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/notifications.md Set up Discord notifications for run summaries by providing a webhook URL. Optional parameters include username and avatar URL. ```yaml notifications: enabled: true discord: webhook_url: "https://discord.com/api/webhooks/..." ``` -------------------------------- ### Configure General Notification Settings Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/notifications.md Enable or disable notifications globally and set parameters for dry runs, preview inclusion, and minimum deletions required to trigger a notification. ```yaml notifications: enabled: true notify_on_dry_run: true include_preview: true min_deletions_to_notify: 1 ``` -------------------------------- ### Streaming-Aware Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/docs/templates.md This configuration leverages JustWatch integration to intelligently manage media libraries. It preserves content not available on any streaming service in the main library and aggressively deletes content available on specified streaming platforms in a separate 'Streaming Copies' library. ```yaml dry_run: true plex: url: "http://localhost:32400" token: "YOUR_PLEX_TOKEN" tautulli: url: "http://localhost:8181" api_key: "YOUR_TAUTULLI_API_KEY" radarr: - name: "Radarr" url: "http://localhost:7878" api_key: "YOUR_RADARR_API_KEY" justwatch: country: "US" language: "en" libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 90 added_at_threshold: 180 max_actions_per_run: 20 exclude: justwatch: # Keep movies NOT available on streaming (you can only watch them locally) not_available_on: ["any"] - name: "Streaming Copies" radarr: "Radarr" action_mode: "delete" last_watched_threshold: 30 added_at_threshold: 90 max_actions_per_run: 50 exclude: justwatch: # Delete freely if available on your streaming services available_on: ["netflix", "disneyplus", "amazon", "hbomax", "hulu"] ``` -------------------------------- ### Configure Trakt and MDBList URLs Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Specify the URLs for your Trakt and MDBList lists. Ensure the format matches the supported patterns for correct processing. ```yaml # Trakt - "https://trakt.tv/movies/trending" - "https://trakt.tv/users/username/lists/listname" # MDBList - "https://mdblist.com/lists/username/listname" ``` -------------------------------- ### Check Disk Space Usage Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Use `docker exec` to run `df -h` within the Deleterr container to verify mounted volumes and disk usage. ```bash docker exec deleterr df -h /data/media ``` -------------------------------- ### Enable Seerr Update Status Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Enable the 'update_status' option to ensure that deleted media is correctly reflected as unavailable in Seerr. ```yaml exclude: seerr: update_status: true ``` -------------------------------- ### Configure Custom Leaving Soon Email Template Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/notifications.md Specify a custom HTML template file for 'leaving soon' notifications. Set the email subject and configure email-specific settings. ```yaml notifications: leaving_soon: template: "/config/my-template.html" subject: "Watch Before It's Gone!" email: # ... email settings ``` -------------------------------- ### Combine Disk Thresholds with Leaving Soon Feature Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/disk-thresholds.md Use disk thresholds in conjunction with the 'Leaving Soon' feature. Items are only tagged to the collection when disk space is low. ```yaml libraries: - name: "Movies" radarr: "Radarr" action_mode: "delete" max_actions_per_run: 20 preview_next: 10 disk_size_threshold: - path: "/data/media" threshold: "500GB" leaving_soon: collection: name: "Leaving Soon" ``` -------------------------------- ### Test Tautulli API Connection Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Use `curl` to test the Tautulli API connection with your provided API key. ```bash curl "http://tautulli:8181/api/v2?apikey=YOUR_KEY&cmd=get_server_info" ``` -------------------------------- ### Specify Disk Threshold Size Units Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/disk-thresholds.md Define the minimum free space required using various supported size units. If free space is above this threshold, the library is skipped. ```yaml threshold: "500GB" ``` ```yaml threshold: "1TB" ``` ```yaml threshold: "100MB" ``` -------------------------------- ### Test Specific Notification Provider Source: https://context7.com/rfsbraz/deleterr/llms.txt Test notifications for a specific provider, such as Discord. Use the --provider flag to select the desired notification service. The configuration volume must be mounted. ```bash docker run --rm -v ./config:/config ghcr.io/rfsbraz/deleterr:latest \ python -m scripts.test_notifications --provider discord ``` -------------------------------- ### Configure Multiple Notification Providers Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/notifications.md Set up simultaneous notifications using multiple providers like Discord and Email for different recipients or purposes. Environment variables can be used for sensitive information. ```yaml notifications: enabled: true # Admin gets Discord + Email discord: webhook_url: !env DISCORD_ADMIN_WEBHOOK email: smtp_server: "smtp.gmail.com" # ... email settings to_addresses: - "admin@example.com" # Users get separate notifications leaving_soon: discord: webhook_url: !env DISCORD_USERS_WEBHOOK email: smtp_server: "smtp.gmail.com" # ... email settings to_addresses: - "users@example.com" ``` -------------------------------- ### Sort by Lowest Rated Content First Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/sorting.md Prioritize deleting lower-rated content to keep higher-quality media. This ensures that the best content remains in the library longer. ```yaml sort: field: "rating" order: "asc" ``` -------------------------------- ### Configure PUID and PGID Environment Variables Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Alternatively, set `PUID` and `PGID` environment variables in your Docker configuration to match your user's IDs. ```yaml environment: - PUID=1000 - PGID=1000 ``` -------------------------------- ### Define Named Radarr and Sonarr Instances Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/multi-instance.md List your Radarr and Sonarr instances at the top level of the configuration. Each instance requires a unique 'name' to be referenced later in library blocks. Ensure 'url' and 'api_key' are correctly set for each instance. ```yaml radarr: - name: "Radarr" url: "http://localhost:7878" api_key: "YOUR_RADARR_API_KEY" - name: "Radarr 4K" url: "http://localhost:7879" api_key: "YOUR_RADARR_4K_API_KEY" sonarr: - name: "Sonarr" url: "http://localhost:8989" api_key: "YOUR_SONARR_API_KEY" - name: "Sonarr 4K" url: "http://localhost:8990" api_key: "YOUR_SONARR_4K_API_KEY" ``` -------------------------------- ### Configure Email Admin Notifications Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/notifications.md Configure email notifications for run summaries, requiring SMTP server details, credentials, and sender/recipient addresses. TLS is enabled by default. ```yaml notifications: enabled: true email: smtp_server: "smtp.gmail.com" smtp_port: 587 smtp_username: !env SMTP_USERNAME smtp_password: !env SMTP_PASSWORD use_tls: true from_address: "deleterr@yourdomain.com" to_addresses: - "admin@yourdomain.com" ``` -------------------------------- ### Configure Generic Webhook Notifications Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/notifications.md Set up a generic webhook to send JSON payloads to any HTTP endpoint. Specify the URL, HTTP method, custom headers, and timeout. ```yaml notifications: webhook: url: "https://example.com/webhook" method: "POST" headers: Authorization: "Bearer your-token" Content-Type: "application/json" timeout: 30 ``` -------------------------------- ### Run Integration Tests with Pytest Source: https://github.com/rfsbraz/deleterr/blob/main/tests/integration/README.md Execute integration tests from the project root directory using pytest, specifying the integration directory and applying the 'integration' marker. ```bash # From project root pytest tests/integration/ -v -m integration ``` -------------------------------- ### Configure SSL Verification Source: https://github.com/rfsbraz/deleterr/blob/main/docs/troubleshooting.md Set `ssl_verify` to `false` if using HTTPS with self-signed certificates to bypass SSL errors. ```yaml ssl_verify: false ``` -------------------------------- ### Sort by Largest Files First Source: https://github.com/rfsbraz/deleterr/blob/main/docs/features/sorting.md Configure deletion to prioritize larger files to reclaim disk space quickly. This is a common strategy for managing storage. ```yaml sort: field: "size" order: "desc" ``` -------------------------------- ### Seerr Include-Only Mode Configuration Source: https://github.com/rfsbraz/deleterr/blob/main/docs/integrations/overseerr.md Use 'include_only' mode to only delete media that was requested through Seerr, leaving manually added content untouched. ```yaml exclude: seerr: mode: "include_only" ``` -------------------------------- ### Test Deleterr Leaving Soon Notifications Source: https://context7.com/rfsbraz/deleterr/llms.txt Run Deleterr to test the default 'leaving_soon' notifications. This command requires the configuration volume to be mounted. ```bash docker run --rm -v ./config:/config ghcr.io/rfsbraz/deleterr:latest \ python -m scripts.test_notifications ``` -------------------------------- ### Cleanup Docker Services Source: https://github.com/rfsbraz/deleterr/blob/main/tests/integration/README.md Navigate to the integration tests directory and stop and remove the Docker containers, volumes, and networks associated with the integration tests. ```bash cd tests/integration docker-compose -f docker-compose.integration.yml down -v --remove-orphans ```