Logic bug in actor person linking when explicit/adult content matching is toggled

Logic bug in actor person linking when Library explicit/adult content matching is toggled
Settings > Manage > Libraries > {library_name_here} > Edit Library > Advanced > Allow matching to explicit content

Description:
When the server-level setting for matching or showing adult/explicit content is enabled or disabled, actors become split into two distinct person records in the metadata database. One person record is linked to a subset of titles and the other to a different subset. The two records do not overlap, so actor filmographies and actor-based search cross-references are incomplete or incorrect.

Observed Behavior:
• When Hide Adult Content is turned on the actor appears as two nonoverlapping person records, each linked to different sets of titles.
• When Hide Adult Content is turned off the actor’s data merges correctly, showing all titles under a single actor entry.
• Refreshing metadata or optimizing the database sometimes temporarily fixes the links, consistent with known metadata agent behavior after setting changes.

Expected Behavior:
Toggling the adult/explicit matching filter should only exclude adult titles from search results and actor references. It should not create duplicate actor records. If the server library does not contain any adult titles, the actor’s full filmography should display under a single record.

Steps to Reproduce:

  1. On a Plex server with some adult and non-adult titles, go to Settings > Library > Advanced (or the relevant section with the “Hide Adult Content” toggle).

  2. Enable Hide Adult Content.

  3. Navigate to an actor who appears in both adult and non-adult titles. Observe that the actor now appears as two separate person records, each linked to a different subset of titles.

  4. Disable Hide Adult Content. Observe that the actor’s record merges and all titles display correctly.

  5. Optionally, refresh metadata or optimize the database to see if this temporarily fixes the split actor records. No changes.

Summary:
This is a metadata agent logic bug where adult content filtering incorrectly partitions actor references into separate records instead of just excluding adult titles from search results.

Server Version#: All versions including current
Player Version#: Apple TV, Web, iOS, latest on all