Maintainerr Documentation Blog https://docs.maintainerr.info/blog/ Maintainerr Documentation Blog Fri, 01 Mar 2024 00:00:00 GMT https://validator.w3.org/feed/docs/rss2.html https://github.com/jpmonette/feed en <![CDATA[Getting Started (S01E01)]]> https://docs.maintainerr.info/blog/getting-started-s01e01/ https://docs.maintainerr.info/blog/getting-started-s01e01/ Fri, 01 Mar 2024 00:00:00 GMT Ok so you installed Maintainerr and don't know where to start.

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.

Tutorial poster

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

AddedLast ViewedTimes ViewedAudience Rating
3Nov202310Jan202447.3

Overseerr

Requested byRequested DateTimes Requested by Anyone
user_girl1232Nov20234

Radarr

Release DateIs MonitoredRuntime
31Oct2023True114 minutes
tip

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.

Link to see how to get your Plex media info and XML data

We want to make a rule that would add this movie to its collection.

note

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.


Rule Setup

We will start from the top of a new rule.

Rule setup screen

  • 1: This is the name of the Rule, and will eventually be the name of the Collection that gets created.
  • 2: Self explanatory, but you can put whatever you want here. It will be shown in Plex when you open the collection.

Plex collection example

  • 3: Drop-down list of your Plex Libraries. Which library is this rule going to be run against?
  • 4: This will not be shown if you select a 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.
  • 5: Sonarr/Radarr action is what is going to happen after the 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.
  • 6: Think of this as a delay setting. How many days after this rule is ran, items have been matched to this rule's filter parameters and added to the collection, will we execute the action set in step 5?

Additional rule settings

  • 7: How many months are we going to keep logs of this collection's actions?
  • 8: Is this Rule active? Will it be one of the rules ran either by a manual run, or through periodic runs?
  • 9: Is this collection going to be shown on the Plex Home screen, or are you only going to be able to see it through the Plex Library screen?
  • 10: When the action set in step 5 is taken, will Maintainerr also send a hit back to Sonarr/Radarr that excludes this item from being automatically added by any import lists?
  • 11: It is recommended to keep this option off as it uses an outdated method. Maintainerr now automatically does this. When the action set in step 5 is taken, will we tell Overseerr that this item is no longer available and can be requested again?
  • 12: You can toggle the rule system off and on. This is useful if you have collections in Plex that you want to see in Maintainerr, but don't want any actions taken on the collection.
  • 13: You can create a collection in Plex, and then use that collection in Maintainerr. If you are doing that, tick this Custom Collection box to on. This can be useful if there is a collection made by PMM or by you, and you want to execute some rules against it.

Discord example


Rule Configuration

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.

note

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.

tip

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.


Rules and Sections

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.

AND

So let's try an AND example.

  • Our rule 1 setup gains us output X and output Y.
  • Our rule 2 setup gains us output X.
  • Our rule 2 is set up with an AND operator to rule 1.
  • The output of this section would be X only. Since X was matched by rule 1 AND rule 2 but Y was only matched by rule 1, it will not be included in the section output because we said we want the output of the section to be everything that matched (rule 1 AND rule 2).

OR

Now an OR example.

  • Our rule 1 setup gains us output X and output Y.
  • Our rule 2 setup gains us output X and output Z.
  • Our rule 2 is set up with an OR operator to rule 1.
  • The output of this section would be X, Y, and Z. Since X and Y were matched by rule 1, and X and Z were matched by rule 2, they are all included because we said we want the output of the section to be everything that matched (rule 1 OR rule 2).

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.

AND/OR

Now let's try a mixed AND / OR example.

  • Rule 1 setup gains us output X and output Y.
  • Rule 2 setup gains us output X.
  • Rule 2 is set up with an AND operator to rule 1.
  • The output is X, as before.
  • Rule 3 setup gains us output G and output M.
  • Rule 3 is set up with an OR operator to rule 2.
  • The output of the whole section would be X, G, and M. Since X was matched by rule 1 AND rule 2 but Y was only matched by rule 1, the output of rule 2 will be only X. Since G and M were matched by rule 3, and we said we want the output of the section to be anything that matches ((rule 1 AND 2) OR rule 3), we get X, G, and M.

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.

]]>
[email protected] (Justin Awtry)
<![CDATA[Rule Creation (S01E02)]]> https://docs.maintainerr.info/blog/rule-creation-s01e02/ https://docs.maintainerr.info/blog/rule-creation-s01e02/ Mon, 25 Mar 2024 00:00:00 GMT Let's go a little further into Rules with some simple examples to get you started.

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.

Tutorial poster

This movie has the following attributes across Plex, Overseerr, and Radarr:

Plex

AddedLast ViewedTimes ViewedAudience Rating
3Nov202310Jan202447.3

Overseerr

Requested byRequested DateTimes Requested by Anyone
user_girl1232Nov20234

Radarr

Release DateIs MonitoredRuntime
31Oct2023True114 minutes

With this information, we have quite a few options that we can use as rule parameters and filters.

Simple Rule

  • 1: We can use one rule that states Plex-Date Added before amount of days 60.
    • This will match in our special tutorial scenario because the day the Movie was added to Plex happened 60 days or more "before" today's date.
  • 2: We could use a rule that states Plex-Times Viewed bigger number 3.
    • This would get added because it has a Times Viewed value of 4, which is bigger than 3.
  • 3: We could also use a rule that states Plex-Audience Rating (scale 1-10) bigger number 5.
    • This rule would catch our movie because its Audience Rating is 7.3, which is bigger than 5.

Simple AND

  • 1: We could add Rule 1 that states Plex-Date Added before amount of days 60. Rule 2 then states AND Plex-Times Viewed bigger number 5.
    • This would not catch our movie because it has a Times Viewed value of 4 and we need it to match (rule 1 AND rule 2). It does match rule 1 but it does not match rule 2. If another movie in the library was added 60 days ago or more AND it had a view count of more than 5, it would get added to this rule.

Let's try one more.

  • 2: Rule 1 states Plex-Times Viewed bigger number 3. Rule 2 states AND Overseerr-Amount of Requests equals Plex-Times Viewed.
    • This rule set would add our movie because its Times Viewed amount is 4, which is bigger than 3, AND the Amount of Requests from Overseerr equals the Times Viewed amount from Plex: (Rule 1 AND Rule 2).

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.

Visual Example

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.])

Simple OR

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.

  • 1: We can use one rule that states Plex-Date Added before amount of days 90.
    • This will not match in our special tutorial scenario because the day the Movie was added to Plex happened only 60 days before today's date. Not quite 90 days yet.
  • 2: Our next rule states OR Overseerr-Requested by user (Plex or local username) Contains (Partial list match) text user_girl123.
    • This would match because, as we can see, that is who requested the movie.
  • 3: This rule set would add our movie because it meets one OR the other of our criteria. It was added 60 days ago so it does not meet our criteria of before 90 days, but it did match the Overseerr requested-by-user rule. It gets added because we said we wanted (Rule 1 OR Rule 2).

Now let's get a visual.

Visual Example

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.

]]>
[email protected] (Justin Awtry)
<![CDATA[Sections (S01E03)]]> https://docs.maintainerr.info/blog/sections-s01e03/ https://docs.maintainerr.info/blog/sections-s01e03/ Fri, 10 May 2024 00:00:00 GMT Why do we even have sections?

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.

Example 1

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.

Example 2

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.

Example 3

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?)

Example 4

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).

Closing

Hopefully you learned a little something today. If not, I will try harder next time.

  • One more thing I would like to add is how an 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.

]]>
[email protected] (Justin Awtry)