blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.66k stars 308 forks source link

delete_watched_tv - doesn't work again if all episodes are deleted #330

Closed XJonnyP closed 2 years ago

XJonnyP commented 2 years ago

I don't think this is a bug but rather a misunderstanding on my end on how this works. I am wondering if there is a workaround..

I set up the script to delete shows based on user and it works great until all of the files for a particular show have been watched. A new one may be added afterwards which is added back to plex with a new grandparent_rating_key, rendering the script obsolete until it's updated again. Show A has episodes 1,2,3. All three are watched, all files are deleted. A week later, episode 4 is added to the library. When plex rescans the library, the show is added back with a new rating key. Now the script needs to be updated.

Is this due to my ignorance and poor setup? If not, is there a workaround?

blacktwin commented 2 years ago

That script should be retired. Use https://github.com/blacktwin/JBOPS/blob/master/utility/media_manager.py going forward. However this script is lacking in the examples so you'll need to ask or be able to read some of the code to figure out what can be done.

You'd need to use Tautulli to setup a script agent and conditions to isolate which shows you want delete. This argument string should work and because Tautulli is tracking the show name then providing the rating_key the rating_key will be correct if updated. python media_manager.py --ratingKey {rating_key} --select watched --users User1 User2

XJonnyP commented 2 years ago

@blacktwin thank you for the quick response. I will take a crack at using this newer script!

XJonnyP commented 2 years ago

Initial test went well and this seems very straightforward. I'll be configuring Tautulli with conditions to isolate the shows.

Thank you @blacktwin