Composable Profiles

Allowing Custom Formats to be conditioned on tags been discussed a few times before (Conditional Custom Formats based on Tags · Issue #7616 · Sonarr/Sonarr · GitHub and Tags condition for custom formats). But I feel that those failed to express what I see as the core problem. So I’m going to try to explain the problem that I think these features would solve.

The Problem

The problem is that I have some rules or requirements that I only want to apply to certain shows. For example:

  1. Some shows I want to get episode by episode. Other shows I want to get only when the season is complete.
  2. Some shows I want to get a dub, others I want the original language.
  3. Some shows I only want from specific groups, others I’ll take anything.

These concerns are orthogonal to what my Quality Profiles focus on which is resolution, HDR, codec …

In Conditional Custom Formats based on Tags · Issue #7616 · Sonarr/Sonarr · GitHub the recommended solution was:

There’s also no clear reason this can’t be accomplished currently with two quality profiles assuming only a dubbed or non dubbed version of a show is needed.
- bakerboy448

The problem with this solution is that it results in a Cartesian product of the variables. Yes, if you go from one to two profiles it isn’t a big deal. But In my case I currently have 9 Quality Profiles which is already tedious to manage. But if I wanted to add the three things above I would end up with 9 * 2 (season vs episode) * 2 (dub vs sub) * 5 (specific groups) = 180 different Quality Profiles which is clearly not reasonable to manage by hand (you would need to automate generation at that point).

So this is the core of the problem. Quality Profiles are monolithic and not composable. Custom Formats are locked behind Quality Profiles making their power hard to fully utilize. This lack of composability is fundamentally the problem I would like to see solved.

Possible Solutions

Tag-Conditioned Custom Formats

This seems like the most obvious solution and one that was proposed before. We can make custom formats activate or deactivate based on tags on the series. This way I could have a few high level Quality Profiles set up then I can tune them to the series with tags. So I can have my “Dub” profile but it is only enabled if I add the require-dub tag.

Parametrized Quality Profiles

This is effectively the same as using tags but rather than reusing tags we add a new mechanism to set the options. This may be desirable if tag use is not desired for some reason.

Quality Profiles Inheritance

This is another approach where you could have your 4k HDR quality profile and then inherit from it to create your 4k HDR Dub profile. The downside is that you still have 180 profiles but at least the vast majority of them are very trivial additions, so that you don’t need to clone your whole profile for each variant.

I don’t think this is the best option, but it is an example of an alternate approach.

My Current Workaround

Collapsed because it is long and somewhat specific to me but may be helpful to understand my setup and maybe point out something that I am missing that would solve this problem with existing functionality.

Because I do not want to open the Pandora’s box of automated Quality Profile generation and management I need to keep the number of them small and manageable. So this is what my current setup looks like

Quality Profiles

For quality profiles I still have a few dimensions. The primary dimension is the target resolution:

  • 2160p
  • 1080p

(I previously had 720p as well, but it wasn’t worth managing the combinations so I removed it. With this feature request resolved I would probably add it back.)

These target resolutions are multiplied by variants to control the minimum resolution accepted. For example for new shows where I know I can get the quality I want I only grab exactly that quality. For older or rarer content I can be more flexible. So I end up with:

  • 2160p min-2160p
  • 2160p min-1080p
  • 2160p min-any
  • 1080p min-1080p
  • 1080p min-any

This dimension might be better as conditional Custom Formats rather than different Quality Profiles but dealing with ranges of resolutions is somewhat the bread and butter of Quality Profiles so I might still keep these as different profiles.

The last two dimensions that I have is HDR vs SDR and codec scoring. These are currently in Quality Profiles mostly because the default is different depending on the profile (For example the min-any groups allow SDR and worse codecs but the 2160p only group defaults to HDR and AV1 or h265). In theory this would 4x my number of profiles but in practice only a few combinations are commonly used so it brings the profiles from 5 to 9. If I could condition my Custom Formats on tags I would remove the extra Quality Profiles and just adjust these with tags (and enjoy the extra flexibility).

So in the end these are my Quality Profiles:

  • 2160p min-2160p require-HDR require-good-codec
  • 2160p min-2160p require-good-codec
  • 2160p min-1080p require-HDR require-good-codec
  • 2160p min-1080p require-good-codec
  • 2160p min-any
  • 2160p min-1080p
  • 1080p min-1080p require-good-codec
  • 1080p min-1080p
  • 1080p min-any

You can see that they are basically just combinations of the same basic rules. There are some missing combinations, some because they are not very useful (for example 2160p min-any require-good-codec) but some are missing just because they are infrequently used and I can’t be bothered to maintain more profiles (example 1080p min-1080p require-HDR).

Release Profiles

Wherever I can I prefer Release Profiles as they are orthogonal to Quality Profiles so it is easier to manage (one Release Profile per feature rather than duplicating the number of Quality Profiles).

  1. Sub vs Dub - By default my profiles don’t have language restriction. I use a tag to ensure that there is english audio.
  2. Full Seasons - By default my profiles allow individual episodes. But I use a tag to require only full-season (or specials) downloads.
  3. Release Group - I have a set of tags to lock a series to a specific release group.

All three of these would be better as Custom Formats but 1 and 3 would apply to every existing Quality Profile which would be an unmanageable explosion in number as discussed. 2 would apply to all but 2 of the “base” profiles which is slightly better but still unmanageable. Basically Custom Formats have more capabilities, but I prefer Release Profiles because they don’t result in a Quality Profile explosion.

Summary

The fundamental problem here is that Quality Profiles lack composability. This means that to add a handful of features in your profiles you would need to create a completely unmanageable amount of them. I am working around this with Release Profiles because they can be enabled or disabled per series with tags but they aren’t nearly as powerful as Quality Profiles (binary rather than scoring, apply globally rather than ability to be controlled with Quality Profile settings, regex on release name rather than benefiting from Sonarr’s parsing and augmentation).

So the feature I want is some way to make these rules composable. Allowing Custom Formats to be conditioned on tags seems like the most obvious solution. But I am open to any solution to this issue.

1 Like

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