everettsouthwick / Eraserr

Python script for deleting unwatched or stale media from Plex servers using Radarr, Sonarr, and Overseerr.
GNU General Public License v3.0
24 stars 1 forks source link

Delete added x days ago and unwatched #25

Closed abnersnell closed 1 year ago

abnersnell commented 1 year ago

Is your feature request related to a problem? Please describe. I would like the ability to delete items "Added at" x days ago with zero "Total Plays".

Excellent job with this script taking into account Overseer, Radarr, Sonarr & Plex on delete!

everettsouthwick commented 1 year ago

Hello @abnersnell, the days_threshold will catch media that was added that number of days ago with zero plays. Perhaps I could add more granularity to allow to differentiate between last watched and unwatched if you wanted to have more control over the number of days between those two (e.g. delete unwatched media 14 days old vs. last watched media 30 days ago). Is that something you're looking for?

abnersnell commented 1 year ago

Your example is what I am looking for. I have two scenarios I would like to delete for:

  1. Delete all media not watched at least once in last 18 months. I set days_threshold = 550 and run this daily. Works perfectly.
  2. Delete all media added 30+ days ago and never watched. As users request new media but don't watch in first 30 days, I would like to not store but instead delete and make them request again.
everettsouthwick commented 1 year ago

This has been added in #27. days_threshold has been removed as a configuration value, and two new configuration values take its place: last_watched_days_deletion_threshold and unwatched_days_deletion_threshold. This should fit your use case and allow you to have two separate thresholds for unwatched vs last watched. These values are required and the script will not execute until they are added to prevent errantly deleting media until they have been configured.