From bb7fe5d1acb2cf630f83d58d715d98e7a076ece9 Mon Sep 17 00:00:00 2001 From: Mike Colagrosso Date: Thu, 16 Jan 2025 16:52:30 -0700 Subject: [PATCH] Search artwork by `UrlName` `Artwork::GetAllByFilter()` is already removing diacritics from search terms, and `UrlName` stores the artist's name with diacritics removed by calling `Formatter::MakeUrlSafe()`. Keeping the search by `Name` because `Formatter::MakeUrlSafe()` makes other changes to the name, too. Fixes #461 --- lib/Artwork.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Artwork.php b/lib/Artwork.php index feb0f961..3deae630 100644 --- a/lib/Artwork.php +++ b/lib/Artwork.php @@ -1069,6 +1069,7 @@ class Artwork{ $params[] = $tokenizedQuery; // art.Name $params[] = $tokenizedQuery; // art.EbookUrl $params[] = $tokenizedQuery; // a.Name + $params[] = $tokenizedQuery; // a.UrlName $params[] = $tokenizedQuery; // aan.Name $params[] = $tokenizedQuery; // t.Name @@ -1089,6 +1090,7 @@ class Artwork{ and (art.Name regexp ? or replace(art.EbookUrl, "_", " ") regexp ? or a.Name regexp ? + or a.UrlName regexp ? or aan.Name regexp ? or t.Name regexp ?) group by art.ArtworkId) x', $params); @@ -1107,6 +1109,7 @@ class Artwork{ and (art.Name regexp ? or replace(art.EbookUrl, "_", " ") regexp ? or a.Name regexp ? + or a.UrlName regexp ? or aan.Name regexp ? or t.Name regexp ?) group by art.ArtworkId