jorenn92 / Maintainerr

Looks and smells like Overseerr, does the opposite. Maintenance tool for the Plex ecosystem
https://maintainerr.info
MIT License
868 stars 19 forks source link

Matching season episodes by Sonarr quality profile ID fails sometimes #1395

Closed Michael-Busse closed 1 day ago

Michael-Busse commented 5 days ago

Describe the bug When creating a rule that triggers by Sonarr Quality Profile ID (why use ID# and not name here as with Radarr?) (Sonarr - Quality profile ID -> Equals -> Number -> #) it will sometimes flag individual episodes in series outside the specified quality profile ID as matching.

Using the Test Media option a single episode is matched from a show not matching the specified quality profile, but all other epiodes of the same show correctly return false for the match.

To Reproduce Steps to reproduce the behavior:

  1. Go to Rules
  2. Click on 'New Rule'
  3. Set library to a TV Series library
  4. Set type to Episodes
  5. Under Rules add a rule with first value: Sonarr Quality Profile ID - Action: Equals - Second Value: Number - Custom Value ID of a quality profile. In my case 9.

I then also have a section/rule that checks if the episode was added more than 365 days ago. But this one works as expected.

Expected behavior Only episodes matching this criteria will show up.

Device (please complete the following information):

benscobie commented 2 days ago

Would you be able to share a screenshot of the Manage Episodes dialog in Sonarr from a season that has one of these problem episodes?

How comfortable are you with calling APIs using Postman/Insomnia/curl in-case we need to dig a bit further?

Michael-Busse commented 1 day ago

Sure - here is Would I lie To You season 16 - where episode 8 shows up in this rule:

image

A test of the episode in Test Media:

And a test of episode 7 in the same season:

I'm experienced using REST API using powershell - not so much using curl directly. But I'm sure i can help with rest API output if needed. I used to do these clean-ups with a powershell script, but Maintainerr is much prefered :) The workaround I use now is to use tags instead of quality profles. And that works perfectly.

benscobie commented 1 day ago

So we look at the individual episode to determine the quality profile here, and episode 8 there is HDTV-1080p unlike the others which are WEBDL-1080P.

Michael-Busse commented 1 day ago

Yes, I noticed that also. But the quality profile follows the show, not the episodes, as far as I've understood?

benscobie commented 1 day ago

You have the type set to Episodes so we look at episode metadata currently (when there's a file downloaded): https://github.com/jorenn92/Maintainerr/blob/cca3b0fae36e6939cb51d1c1c83ec8bc7cda6f48/server/src/modules/rules/getter/sonarr-getter.service.ts#L147

We could always introduce a new rule that targets the season/show level in this instance. Feature requests here: https://features.maintainerr.info/

Michael-Busse commented 1 day ago

Ah, so in this case it looks at the Plex metadata instead of the sonarr quality profile id? As the quality profile is on the show level and not on the episode level. I see the confusion here.

Tags are working fine for me, so this is a non-issue at the moment. But yes, I may do a feature request for future checks. Thank you for quick feedback :)

benscobie commented 1 day ago

It does look at the Sonarr quality profile, just at the episode level. Of course we don't typically think of an episode having a quality profile but they can differ due to upgrades etc. It sounds to me you want the 'desired' level in a way.