Skip to content

Match artist creation lookups using CleanName - #18005

Merged
crobibero merged 2 commits into
jellyfin:release-12.zfrom
orut34iop:codex/upstream-raw-name-index
Sep 27, 2026
Merged

crobibero merged 2 commits into
jellyfin:release-12.zfrom
orut34iop:codex/upstream-raw-name-index

Conversation

@orut34iop

@orut34iop orut34iop commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Changes

The single-artist lookup used by CreateItemByName still matches lower(Name), while FindArtists matches CleanName. Names that differ only in accents, punctuation, or whitespace can therefore resolve differently in the two paths. Remove the MusicArtist lookup's UseRawName override so both use the same normalization and the existing IX_BaseItems_Type_CleanName index. The preference for a filesystem artist over a by-name artist is preserved. No new index or database migration is needed.

Rebased onto release-12.z, which is now the target branch.

Validation

5 tests passed: ArtistNameLookupTests, covering normalization, the actual SQLite query plan, and filesystem-artist precedence. Tested with .NET 10 in Release configuration on macOS arm64, with timestamped build metadata.

Code assistance

Codex assisted with implementation, regression testing, and these PR-description updates. The contributor supplied and edited the initial Chinese descriptions.

Issues

No linked issue.

Chinese explanation (updated for this revision)

艺术家的单条查询仍使用原始名称,而批量查询已使用 CleanName,导致重音符号、标点或空格不同的名称可能得到不一致的结果。按维护者建议移除单条查询的 UseRawName 覆盖,复用现有 Type + CleanName 索引,并保留优先选择文件夹内艺术家的行为。新增索引及数据库迁移已撤掉。

@Shadowghost

Shadowghost commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for the PR but I think this is rather treating the symptom of the actual issue:
UseRawName only exists to keep CreateItemByName in sync with FindArtists. That was #15689, where FindArtists matched on lower(Name). In 9220c2b it moved to CleanName, and CreateItemByName was never updated.

So the actual fix would be to rewrite the MusicArtist lookup uses CleanName like every other by-name type, it hits the existing IX_BaseItems_Type_CleanName - would you be up for reworking it that way?

Same with the other PRs: please retarget and rebase onto the release branch too.

@orut34iop
orut34iop force-pushed the codex/upstream-raw-name-index branch from 34c96b4 to b7ad2d0 Compare September 12, 2026 13:45
@orut34iop
orut34iop requested a review from a team as a code owner September 12, 2026 13:45
@orut34iop
orut34iop changed the base branch from master to release-12.z September 12, 2026 13:45
@jellyfin-project-automation jellyfin-project-automation Bot added this to the v12.1 milestone Sep 12, 2026
@orut34iop orut34iop changed the title Index raw item name lookups by type in SQLite Match artist creation lookups using CleanName Sep 12, 2026
@Shadowghost
Shadowghost removed the request for review from a team September 12, 2026 14:03
@Shadowghost Shadowghost added the stable backport Backport into the next stable release label Sep 12, 2026
@jellyfin-bot

jellyfin-bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Jellyfin API (v 12.1.0)


Result


No differences. Specifications are equivalent

@Shadowghost

Copy link
Copy Markdown
Contributor

UseRawName is now dead code and I think we can remove it. Also, you should squash the commits, otherwise we will have the migration in the history too.

@orut34iop
orut34iop force-pushed the codex/upstream-raw-name-index branch from b7ad2d0 to e647b23 Compare September 12, 2026 16:59
@orut34iop

Copy link
Copy Markdown
Contributor Author

Addressed the follow-up items:

  • Removed the now-unused UseRawName property and query translation branch.
  • Squashed the PR to one commit, so the superseded migration is no longer present in the branch history.
  • Rebased onto the current release-12.z.
  • Fixed the CodeQL CA2100 warning in the query-plan test helper; the SQL is generated by EF Core and values remain bound parameters.

The focused artist lookup tests pass locally (5/5).

@theguymadmax theguymadmax moved this from Review to Approved in Jellyfin v12 Sep 12, 2026
@crobibero crobibero moved this from Approved to Review in Jellyfin v12 Sep 13, 2026
@crobibero crobibero modified the milestones: v12.1, v12.2 Sep 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

@crobibero
crobibero merged commit d341176 into jellyfin:release-12.z Sep 27, 2026
15 of 16 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Jellyfin v12 Sep 27, 2026
jellyfin-bot pushed a commit that referenced this pull request Sep 27, 2026
Match artist creation lookups using CleanName

Original-merge: d341176

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
@jellyfin-bot jellyfin-bot removed the stable backport Backport into the next stable release label Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants