blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.67k stars 307 forks source link

[Feature Request] Remove content based on when it was last viewed #321

Closed ShadowFM closed 2 years ago

ShadowFM commented 2 years ago

Is your feature request an improvement on an existing script? Please link to script. The idea of the script is to remove content from Plex that has been viewed in the last x months. If it has not been viewed at all, it should be permanently removed in Radarr/Sonarr using the exclude function. To find out if and when the content was last viewed, Tautulli can be used.

Is your feature request related to a problem? Please describe. Because the content is not deleted, there is hardly any free space left.

Describe alternatives you've considered The only idea is to remove content manually, but it takes a long time to control it.

blacktwin commented 2 years ago

See https://github.com/blacktwin/JBOPS/blob/master/utility/media_manager.py

To check the results:

python media_manger.py --select lastPlayed --action show --libraries "That One Library" --date 2021-01-01

Checking library: 'That One Library' watch statuses...
11 item(s) have been found.
The following items were last played before 2021-01-01 (359 days)
.....

To delete the results: python media_manger.py --select lastPlayed --action delete --libraries "That One Library" --date 2021-01-01

Add --toggleDeletion if you don't have Media Deletion enabled and only want to turn it on when using the script.