The rule system behind Maintainerr is quite complex, and therefore powerful. Getting started can be a little daunting at first. That is only because it is new to you. When you get the hang of it, you will be cleaning up that mess you call a library in no time. This is the first in a series of tutorials that should help you get more familiar with the rules and rule setup.

Let's take the above movie as an example. This isn't a real movie, but for the purposes of this tutorial we are going to pretend. This movie has the following attributes across Plex, Overseerr, and Radarr:
Plex
| Added | Last Viewed | Times Viewed | Audience Rating |
|---|---|---|---|
| 3Nov2023 | 10Jan2024 | 4 | 7.3 |
Overseerr
| Requested by | Requested Date | Times Requested by Anyone |
|---|---|---|
| user_girl123 | 2Nov2023 | 4 |
Radarr
| Release Date | Is Monitored | Runtime |
|---|---|---|
| 31Oct2023 | True | 114 minutes |
This information can be looked at for an actual item in your Plex library. You can do it through the Plex UI or you can parse through the XML of an item.
We want to make a rule that would add this movie to its collection.
There are many more attributes available in the API responses of Plex, Sonarr/Radarr, and Overseerr. We are only looking at these specific ones for the tutorial.
Also, this won't be the only movie in the collection. However, all of the other movies that will be added into this collection matched the rule set for the same reasons.
We will start from the top of a new rule.


Movies library in step 3. If you selected a TVShow library, your options will be shows, seasons, or episodes. What type of TV show media are we going to run the rule against? An entire show, just seasons, or just episodes? Different options will be made available to you or taken away, depending on what you select here.action after days set in step 6. Options are dependent on the library and media type from above. Delete will remove the files and the item from Sonarr/Radarr. Unmonitor and delete will unmonitor, but not remove, the item from Sonarr/Radarr and then delete the files. Unmonitor and keep will unmonitor the item from Sonarr/Radarr and keep the files.

Now we are getting into the details. After the settings above have been configured to your liking, you start to craft the rule logic. There is a button labeled Community, which contains rule setups that have been shared by others. Clicking on this button will list the uploaded rules, and you can use one of these rules if you wish. Clicking on a rule and then clicking on the info button down below will give you the uploader's description of that rule and possibly how it works.
Community rules are just that, from the community. They may not work like they say they do. They may not be formatted properly. It can be a nice place to start, but I personally wouldn't rely on them as everyone's situation is different.
Below the Community button there are two other buttons: Import and Export. You can import a rule from a txt file in YAML format. This is an advanced method, but it is an option.
If you want to go down this path, I would choose one of the Community rules, it doesn't really matter which one, and then use the export button. You will get a generated YAML format of the rule. If you are familiar with YAML this will be a good place to start.
Take a look at this page for the proper syntax of each parameter: Rules Glossary.
If you are looking at a rule that you have already created, you can export the rule in YAML format in order to share it or textually edit it.
Understanding rules and sections can be crucial to getting your rule setup properly and achieving your desired outcome.
When you first start, you will be in the first section: Section 1, Rule 1. A section is a grouped set of rules with one output over the whole section, depending on what was matched in the rules within that section.
So let's try an AND example.
Now an OR example.
This is probably the simplest form of a rule setup that you can get, unless of course you are only using one rule because anything matched by that one rule becomes the output.
Now let's try a mixed AND / OR example.
This is a very good jumping off point for you to start making rules. If you are still not 100% confident yet, or just want more, take a look at S01E02 and go even deeper down the rabbit hole.
]]>In episode 1 we went over a super basic outline of rules and sections, operators, and general rule setup. In today's episode we will go over some simple rule examples. You could set up a few AND rules and roll with it, but then you wouldn't be using Maintainerr to its full potential. This episode should give you a good base of rule knowledge to build off of.
Let's bring back the Movie from episode 1, that we wanted to add into our new collection.

This movie has the following attributes across Plex, Overseerr, and Radarr:
Plex
| Added | Last Viewed | Times Viewed | Audience Rating |
|---|---|---|---|
| 3Nov2023 | 10Jan2024 | 4 | 7.3 |
Overseerr
| Requested by | Requested Date | Times Requested by Anyone |
|---|---|---|
| user_girl123 | 2Nov2023 | 4 |
Radarr
| Release Date | Is Monitored | Runtime |
|---|---|---|
| 31Oct2023 | True | 114 minutes |
With this information, we have quite a few options that we can use as rule parameters and filters.
Plex-Date Added before amount of days 60.
Plex-Times Viewed bigger number 3.
Plex-Audience Rating (scale 1-10) bigger number 5.
Plex-Date Added before amount of days 60. Rule 2 then states AND Plex-Times Viewed bigger number 5.
Let's try one more.
Plex-Times Viewed bigger number 3. Rule 2 states AND Overseerr-Amount of Requests equals Plex-Times Viewed.
Those are some fairly simple AND examples, and hopefully it is starting to become obvious what is going on. Within a section, and only using AND operators, each item also needs to match the rule before it to be counted as a match and added to the collection.
Another way to look at these examples is that within a section, each rule is making a list. The next rule is checking that list to see if anything also has that value, plus the value of its own rule.
graph LR
title:>Rule-set: Rule1 AND Rule2]
A([Has it been viewed in Plex more than 3 times?]) -->|Yes|B([AND is it monitored in Radarr?])
B -->|Yes| C([Add it to the collection])
B -->|No| D([Don't add to the collection.])
We don't have to go too far in depth with this because of what we have already learned. We will just give a quick example, then a visual.
Plex-Date Added before amount of days 90.
Overseerr-Requested by user (Plex or local username) Contains (Partial list match) text user_girl123.
Now let's get a visual.
graph LR
title:>Rule-set: Rule1 OR Rule2]
A([Was it added to Plex before 90 days?]) -->|No|B([Did it match one OR the other]);
C([Was it requested by user_girl123]) -->|Yes|B;
B -->|Yes|D([Add it to the collection]);
Again, I hope this is starting to come together. In our next episode we will go over the use of sections and when they can be useful. Stay tuned.
]]>It has been said that another word for sections could be group. The reason behind a section is to group a section of rules together. We need a way to group a few rules together that we don't want to be part of the main rule set.
This is especially helpful when we need an OR to be ran without it affecting the rest of our rule. In the below example, an item would be included even if it didn't match our other rules if we ran them all in one section.
flowchart LR
subgraph Section1
A(Was it added to Plex before 90 days?)-.AND.->B(Is it monitored in Radarr?)
B -.OR.->C(Was it requested by user_girl123?)
end
C -->D(Add it to the collection)
In this example it would only have to have been requested by user_girl123 to have matched our rules and be added to the collection. Because we said we wanted Rule1 AND Rule2 OR Rule3. If user_girl123 requested this item but it was not added to Plex before 90 days, it would have matched anyway and been added to the collection. In this tutorial episode, that isn't what we want.
Now let's see what would happen in a section example.
flowchart
subgraph Section1
A(Was it added to Plex before 90 days?)-.AND.->B(Is it monitored in Radarr?)
end
B -->C(Section 1 Results)
subgraph Section2
D(Was it requested by user_girl123?) -.OR.->E(Has it been watched more than 2 times?)
end
E -->F(Section2 Results)
C -->G(Section1 AND Section2)
F -->G
G ==>H(Add to the collection)
In this example we added another rule to the mix. This Section 1 setup would catch items that were added to Plex before 90 days AND monitored in Radarr, regardless of if they were requested by user_girl123 or watched more than 2 times. The Section 2 setup would catch items that were requested by user_girl123 OR watched more than 2 times.
In order for something to match the overall rule set, it would have to meet our Section 1 results AND our Section 2 results. It would need to have been added to Plex before 90 days AND monitored in Radarr AND watched more than 2 times. Or, it would have to have been added to Plex before 90 days AND monitored in Radarr AND requested by user_girl123.
Maintainerr runs the rules in a section in order from Rule 1 to Rule X. So when you are making your rules, keep that in mind. This can be useful in a large library where your first rule could potentially match a lot of items. It is advisable to put this rule at the end of the section. One example could be a rule that is like this:
Don't do:
flowchart LR
A(Does it have zero views?)--AND-->B(Is it older than 3 years?)
B --AND-->C(Does it not include the Radarr tag *save* ?)
This example is going to have a lot of results for the zero views rule, potentially 4k out of a 6k and above movie library. It would be better in this instance to put the zero views criteria at the end. Due to the way Maintainerr runs the rules in order, its list from rule 1 could be everything that is older than 3 years, potentially only 2k out of the 6k plus movies, then we only have to sift through those 2k items to find the ones that have zero views. It could be even further reduced if, say, 300 of those have the save tag. We shaved off 2k movies that need to be checked for zero views. These numbers are made up, but this could possibly be the difference of a few hours in a rule execution, or worst case the rule crashes before completion.
Do:
flowchart LR
A(Is it older than 3 years?)--AND-->B(Does it not include the Radarr tag *save* ?)
B --AND-->C(Does it have zero views?)
This will be our last example and scenario for sections.
flowchart LR
subgraph Section1
A(Was it added to Plex before 90 days?)
end
subgraph Section2
B(Is it monitored in Radarr?)
end
subgraph Section3
C(Was it requested by user_girl123?)
end
A-.AND.->B
B-.AND.->C
C ==> D(Results)
This is the same thing as putting all of those rules in one section: Section 1 results AND Section 2 results AND Section 3 results. There is no need to do this and you should keep them all in one section: (Section 1: Rule 1 AND Rule 2 AND Rule 3).
Hopefully you learned a little something today. If not, I will try harder next time.
OR works when compared to an AND. Again, Maintainerr runs rules in order and makes a list. When Rule 1 gets looked at, a list is created. When Rule 2 is an AND to Rule 1, Rule 2 criteria gets matched only to items in the Rule 1 list. If Rule 2 was an OR to Rule 1, the entire library gets looked at again during Rule 2 to see if anything matches its criteria. This list gets added to the Rule 1 list.Please send me an email at [email protected] for suggestions on what to cover in the next episode.
]]>