Introducing staleaudit-for-plex, a command-line utility that helps you identify stale and large content in your Plex library using watch-data from within Plex.
staleaudit-for-plex connects read-only to your Plex server’s sqlite db and outputs a table containing:
Items that are older than 18 months (by default)
Items that haven’t been watched in 18 months (by default)
Sorted by size, descending
Because it’s read-only, you use the Plex UI (and your *Arr services if applicable) to delete the content - so it’s pretty safe.
I’ve just started working on this and expect there to be bugs and issues, but so far I’ve found this really useful in removing content no one has been watching for a while.
I wrote a Django app to look at the same type of information with added date and play date via Tautulli, and then allow you to utilize Radarr/Sonarr’s apis to delete the items. I added functionality to add things to a permanent save list so they no longer show in the filter list. Seems to work pretty well to keep storage in check.
Good question! My understanding is I’d have to futz with the dates in the filter regularly to have it pay attention to “trailing X months” (both for createdBefore and lastWatched). Also, I’d need to do that per library, I believe. This just taps in and allows me to do cleanup quicker.
If I’m mistaken, let me know! I can research more into what you’re describing but a quick glance at the UI doesn’t give me the impression I can do that.
Especially if you want to start utilizing the APIs to do the deletion for you, smart collections aren’t the easiest method to gather the data set you’re looking for. In my opinion.
Ah, well, given the goal I had was “stale and large content”, I suppose there’s still a place for this tool in the world. Thanks for sharing the knowledge nevertheless. <3