Skip to content

fix: preserve Plex IMDb rule evaluation behavior#2528

Merged
enoch85 merged 1 commit into
mainfrom
fix/plex-imdb-rule-evaluation
Mar 25, 2026
Merged

fix: preserve Plex IMDb rule evaluation behavior#2528
enoch85 merged 1 commit into
mainfrom
fix/plex-imdb-rule-evaluation

Conversation

@enoch85

@enoch85 enoch85 commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

What this changes

This PR fixes Plex IMDb rules so they behave more reliably when you test or run rules.

In short:

  • Maintainerr now asks Plex for the extra metadata needed to read IMDb ratings
  • it does that for the item itself, and also for parent or grandparent items when needed
  • rule comparisons are stricter when the main value is missing, so we do not get false matches from null values
  • at the same time, it keeps the older behavior that avoided a separate set of regressions in 3.2.0

Why this was needed

There were really two problems mixed together:

  1. Plex was sometimes not returning the IMDb rating in the metadata we were using for rule evaluation.
  2. A null-handling fix stopped one bad result, but the broader version of that fix also changed other rule behavior compared with 3.1.0.

This PR fixes both without adding extra load to the users Plex server.

What changed in practice

  • Plex metadata requests used during rule evaluation now ask for external metadata, which is where the IMDb rating comes from.
  • Those requests were kept intentionally narrow so we do not trigger extra Plex refresh work during a normal rule check.
  • If the main value for a comparison is missing, the rule now fails safely instead of comparing through null.
  • If the secondary comparison value is missing, we keep the older behavior so existing rule results do not unexpectedly change.
  • This also brings back useful Test Media results for the missing-value cases we were fixing, instead of leaving those checks confusing or misleading.

Tests run

  • yarn workspace @maintainerr/server test --runTestsByPath src/modules/api/plex-api/plex-api.service.spec.ts src/modules/rules/getter/plex-getter.service.spec.ts src/modules/rules/tests/rule.comparator.service.executeRulesWithData.spec.ts

Should help with #2441

@enoch85

enoch85 commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot /release-pr

@enoch85 enoch85 merged commit 946dd0e into main Mar 25, 2026
22 checks passed
@enoch85 enoch85 deleted the fix/plex-imdb-rule-evaluation branch March 25, 2026 21:27
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant