rfsbraz / deleterr

Deleterr is a Python script designed to help you manage available disk space in your Plex media server.
MIT License
118 stars 6 forks source link

feat: Add support for disk size filter (#67) #70

Closed rfsbraz closed 4 months ago

rfsbraz commented 4 months ago

This PR adds support for setting disk size thresholds.

Library deletion rules will only apply if the available disk size is below the threshold you defined, like so:

- name: "Movies"
  action_mode: "delete"
  last_watched_threshold: 30
  added_at_threshold: 120
  max_actions_per_run: 5
  radarr: Radarr
  disk_size_threshold:
    - path: "/data/media/local"
      threshold: 1TB

The list can include multiple paths, but all of them must exist in the Sonarr/Radarr list of paths (you can check it through /system/status on your instance. This is because deleterr and the instances can run on entirely different contexts so we have no way of checking the disk size directly, unless the data paths were mapped into the container deleterr is running on, and I'm afraid that would introduce to much attrition to the setup.

coveralls commented 4 months ago

Coverage Status

coverage: 80.231% (+11.2%) from 69.032% when pulling d100472af757c15642f86116beedc060d044b386 on feature/support-disk-size-filter into cb444b0a12a381e3ba2e5ccff1107c5632de42ee on develop.

github-actions[bot] commented 4 months ago

:robot: A Docker image for this PR is available to test with:

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

This assumes you have a config and logs directory where you're running the command. You can adjust the volume mounts as needed.