ISSUE: Keep X Episodes not working as expected and other auto deletion woes

I made a video of this issue to help better explain it.

What is happening:
I have Full Frontal set to Keep 5 unwatched episodes.
I add a 6th.
Plex does not delete the oldest episode.

I then turn the option off and back on.
Plex then DOES delete the episode.

https://support.plex.tv/articles/226074728-setting-up-recordings/

According to the only place I can find this option referenced in the support articles:

“If you choose “3 episodes” and you currently have 3 unwatched episodes, then when a new episode gets recorded, the oldest existing episode will automatically be removed.”

Attached are my logs for what I show in the video.

After testing this feature for a week…it’s a absolute train wreck. I have 25 shows I am testing it with (some daily, some nightly, some weekends only, some weekdays only, etc) and I still have absolutely no clue when the delete is supposed to happen and what triggers it. Some of the shows have 5 episodes, some have 6, and two of them have 7.

Besides this feature not working as described, I also have problems with the way it was implemented as a whole which I brought up here forums.plex.tv/discussion/318637/keep-episodes-auto-deletion-options#latest

Is this feature ever going to be flushed out and looked at again?

Well, after some more messing around, I’ve mostly figured this out. To help anyone else that has been stumbling around on google for 2 weeks pulling their hair out over this feature, I’ll put everything I learned in this post in the hope they eventually stumble here.

So, you were messing about on your TV Show settings and you found this:


If you are like me, you have been waiting for and requesting and seeing other request this feature for years. I’ve seen it requested for sonarr/sickbeard/nzbget/sabnzb/tautulli/plex and pretty much any program that has anything to do with a media center PC. I’ve seen custom scripts, cron jobs, you name it.

First and foremost, the only official documentation for this feature I am able to find is here: https://support.plex.tv/articles/226074728-setting-up-recordings/

For some reason, it’s on the DVR page, and it’s worded in a way that suggest it only works with DVR stuff. It doesn’t! It actually will work on any TV Show. The wording for the wiki is also incorrect when it states “then when a new episode gets recorded, the oldest existing episode will automatically be removed” but we will get more into that in a bit.

The official documentation is enough to go on to get you going. It will explain the (odd, more on that later as well) way the feature works for the most part, but here are some things to note.

This feature only deletes episodes at 2 times. The first time is any time you change a setting, if you are OVER the amount of episodes you are keeping with the new settings, when you save them it will automatically trim you down to the correct amount. The ONLY other time this deletion seems to run (someone chime in if they know differently please) is whenever you have Plex set to run it’s Scheduled Tasks.

This official documentation for Schedule Tasks is here: https://support.plex.tv/articles/201553286-scheduled-tasks/

but it does not mention this feature, nor anything about deleting episodes. You can find schedule tasks in Plex Web under Settings->Server->Scheduled Tasks.

I am unsure which of the check marks (if any) toggle episode deletion.

Now, you may think “Whatever, when does the timing of when it deletes the episode matter?” and you are kind of right, it’s not that big of a deal, but it can cause a LOT of confusion. Since it’s not deleting them when you get a new episode (as the support page says) you will get more then the X amount of episodes you have it set to when you get new episodes, till it trims them back down during Maintenance.

Another thing to keep in mind, is if you are using Sonarr, you want Sonarr to know when Plex has deleted said episodes.

First things first, in Sonarr, under Settings->Media Management, make sure you have “Ignore Deleted Episodes” under File Management toggled on.

This is important so Sonarr doesn’t keep downloading the episodes over again when Plex deletes them.

Still in Sonarr, under System->Tasks you will find the “Refresh Series” task. This task is set to run every 12 hours (with no way to change that from what I can tell) with seemingly no way to specify when it runs.

You are going to want Sonarr to run the “Refresh Series” task right after Plex runs it’s episode deletions, and you can do that in two different ways. The first way is to change it in Plex to run Scheduled Tasks right BEFORE Sonarr is running Refresh Series. This is easy, the setting is right on the Schedule Task page to change the time.

Your other option is to change Sonarr to run Refresh Series right AFTER Plex runs it’s Schedule Tasks. To do this, you will have to wait till right after Plex deletes episodes, then MANUALLY execute the Refresh Series task in Sonarr. This will trigger Sonarr to reset it’s 12 hour timer. Alternatively, if you want Sonarr to refresh at say, 3am, you can run the task at 3pm, since it is a 12 hour timer.

Why is this important? If your Sonarr gets better quality episodes when it can, you run the change of a episodes that are deleted (that Sonarr doesn’t know are deleted yet cause it hasn’t refreshed) redownloading higher quality versions and then popping back up in Plex.

This can be compounded by the fact that since a lot of people use this feature on Daily/Nightly/etc kind of shows, that tend to be released in bursts, sometimes you will go 2-4 days with out getting episodes and then get 2-4 all at once. If you have it set to keep 5, suddenly you have 9. Plex runs it’s deletion task, you are back down to 5. Then since Sonarr hasn’t refreshed series yet, it finds higher quality versions and redownloads and you are back to 9.

The combination of all these can cause what seems like a random number of episodes being kept instead of what you have the setting set to.

Also keep in mind the setting (bafflingly) only applies to Unwatched Episodes by the Admin. That means if you have it set to keep 5 and you watch one of them, you will have 6 total, etc. You can try to alleviate this with the “Delete episodes after watching” setting but depending on what your goal is this can be helpful to completely useless. A workaround for this is either don’t watch stuff on your admin account, or marked things as unwatched after watching them.

Things that could use Fixin’:

This feature is incorrectly categorized under “Setting Up Recordings” on the support page.

The description of the feature incorrectly suggests it works for recordings only (“if you record the nightly news” ", “new episode gets recorded” etc) on the support page.

The description of the feature incorrectly states “when a new episode gets recorded, the oldest existing episode will automatically be removed” instead of that it runs as a schedule task.

The feature isn’t listed under the Schedule Task support page.

Things that could be improved:

Episodes should be deleted as they are added not once a day. This would clear up a lot of inconsistency with the feature. Deleting once a day only works if you are under the assumption that you can only get a max of one episode a day. Even then it still will flicker between 5 and 6.

The option should be much, much more advanced. It is extremely limited right now. IMHO, something like this:
Keep a maximum of [NumberFillForm] [DropDown](Watched/Unwatched/Watched or Unwatched) [DropDown](Episodes/Days Worth of Episodes)
Which would add infinite more flexibility while still keeping it a once sentence feature that is easy to use.

This feature should be togglable per library as well as per show, or at LEST the advanced tab should be showing up when I shift click edit multiple shows in plex web at once.

Once polished up, this feature absolutely needs to be advertised with an announcement/blog post. People are constantly looking for a way to do this and IMO it makes the most sense for Plex to be handling it.

3 Likes

I know its an old thread, but worth a bump giving the excellent information FrostyWolf provided above and given the fact that this option still seems to be a little broken and very confusing after all this time. It would be good to see some improvements made as suggested.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.