Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule outcome clashes with media testing #1468

Closed
adrianipopescu opened this issue Dec 24, 2024 · 7 comments
Closed

Rule outcome clashes with media testing #1468

adrianipopescu opened this issue Dec 24, 2024 · 7 comments

Comments

@adrianipopescu
Copy link

adrianipopescu commented Dec 24, 2024

Describe the bug
I have a rule to filter tv shows for deletion. That rule's outcome during test media returns false for a few items yet when I run the rule they get added to the collection anyway.

To Reproduce

- plexId: [REDACTED]
  result: false
  sectionResults:
    - id: 0
      result: false
      ruleResults:
        - operator: OR
          action: not_contains_partial
          firstValueName: Sonarr - [list] Tags (show)
          firstValue:
            - [REDACTED]
            - legacy
          secondValueName: text
          secondValue: legacy
          result: false
        - operator: OR
          action: contains_partial
          firstValueName: Tautulli - [list] Users that saw all available episodes
          firstValue: []
          secondValueName: Overseerr - Requested by user (Plex or local username)
          secondValue: []
          result: false
    - id: 1
      result: false
      operator: OR
      ruleResults:
        - operator: OR
          action: before
          firstValueName: Tautulli - Last view date
          firstValue: null
          secondValueName: custom_days
          secondValue: 5184000
          result: false
    - id: 2
      result: false
      operator: OR
      ruleResults:
        - operator: OR
          action: before
          firstValueName: Tautulli - Date added
          firstValue: 2024-12-23T23:15:41.000Z
          secondValueName: custom_days
          secondValue: 2024-08-26T02:57:04.983Z
          result: false
    - id: 3
      result: false
      operator: AND
      ruleResults:
        - operator: OR
          action: not_contains_partial
          firstValueName: Sonarr - [list] Tags (show)
          firstValue:
            - [REDACTED]
            - legacy
          secondValueName: text
          secondValue: legacy
          result: false

Device (please complete the following information):

  • Docker (Debian Bookworm)
  • latest, container is 2.4.0
@benscobie
Copy link
Collaborator

benscobie commented Dec 24, 2024

Could you share the results of this for a few of those media items that are being added?
http://maintainerr.home.arpa/api/plex/meta/$plexId

Would you also be able to enable debug logging: https://docs.maintainerr.info/Installation/#enabling-debug-logging_1 - remove the item(s) from the collection, run test media, re-run the rules so that they get added again and attach your logs.

Do you only have the one Plex library for TV shows? How large is it? Are you using just 1 Sonarr server?

@benscobie benscobie reopened this Dec 24, 2024
@benscobie
Copy link
Collaborator

benscobie commented Dec 24, 2024

Have you also manually checked this TV show in Sonarr, Tautulli & Overseerr to see if the data being returned by test media is actually correct?

@adrianipopescu
Copy link
Author

adrianipopescu commented Dec 24, 2024

sadly yes, the core of the rule is the legacy tag which immediately causes a false, and as the last section+rule, with "and" as a prefix should immediately cause everything with that tag to be false, and the test does indeed show that correctly.

explainer: everything with legacy is / should be excluded from triage

@ydkmlt84
Copy link
Collaborator

The problem is most likely that the item is still in the Plex collection. Even though the rule should not include it. To verify this, you could could change the description of the rule, see in Maintainerr that the collection is empty. Look in Plex and see the items still in the collection. If you look at your logs, I am willing to bet that the items are added into the collection AFTER the logs state that the rule execution is done.

[maintainerr] | 24/12/2024 16:26:14  [INFO] [RuleExecutorService] Executing rules for 'Some Collection'
[maintainerr] | 24/12/2024 16:26:17  [INFO] [RuleExecutorService] Execution of rules for 'Some Collection' done.
[maintainerr] | 24/12/2024 16:28:20  [INFO] [CollectionsService] Adding media with id 83221 to collection..
[maintainerr] | 24/12/2024 16:28:20  [INFO] [CollectionsService] Adding media with id 83188 to collection..

That is just an example of what I mean.

[maintainerr] | 24/12/2024 16:27:23  [INFO] [RuleExecutorService] Executing rules for 'Old TVShow Seasons (going away soon)'
[maintainerr] | 24/12/2024 16:28:20  [INFO] [RuleExecutorService] Adding 2 media items to 'Old TVShow Seasons (going away soon)'.
[maintainerr] | 24/12/2024 16:28:20  [INFO] [CollectionsService] Adding media with id 83221 to collection..
[maintainerr] | 24/12/2024 16:28:20  [INFO] [CollectionsService] Adding media with id 83188 to collection..
[maintainerr] | 24/12/2024 16:28:20  [INFO] [RuleExecutorService] Execution of rules for 'Old TVShow Seasons (going away soon)' done.

The first example is what I am talking about and the second example is what it looks like when the rule is the one that added the items to the collection. The Done comes after the media is added.

What I believe is happening, is that the item is in the Plex collection and was never removed by Maintainerr, like it probably should have been at some point. When the rules are ran, Maintainerr is syncing with Plex, and those items are being added into the collection as manual additions.

If you had a rule and collection in both Plex and Maintainerr, and manually added something to the collection in Plex...Maintainerr syncs that item into the Maintainerr collection as a manual addition. The same works with exclusions. This is expected behavior.

@benscobie for some reason, changing a rule is not being synced back to Plex to clear out the collection. In Maintainerr the collection will show 0 items, unless you Run Rules right after, but in Plex the items are still in there. When the rule runs again, anything that doesn't meet rule criteria is added as a Manual addition, instead of being removed from the collection. I cannot recreate this on my own instance, but I have seen it a few times recently.

SORRY FOR THE NOVEL!

@benscobie
Copy link
Collaborator

It could be that ^ yes. #1467 will fix that.

@benscobie
Copy link
Collaborator

@adrianipopescu please try v2.4.1. You may want to recreate the rule(s) that had this problem.

@adrianipopescu
Copy link
Author

tried, worked, can mark this as closed.

thank you for your time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants