From 67de6b1147120bc1d3a2162d56e64332d06015b4 Mon Sep 17 00:00:00 2001 From: Gykes <24581046+Gykes@users.noreply.github.com> Date: Wed, 3 Dec 2025 19:43:20 -0800 Subject: [PATCH] regex + revert test --- pkg/sqlite/performer_test.go | 2 +- ui/v2.5/src/utils/url.ts | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/sqlite/performer_test.go b/pkg/sqlite/performer_test.go index d0452d4ba..d5d8ce2fa 100644 --- a/pkg/sqlite/performer_test.go +++ b/pkg/sqlite/performer_test.go @@ -445,7 +445,7 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) { url = "url" twitter = "twitter" instagram = "instagram" - urls = []string{instagram, twitter, url} // sorted alphabetically + urls = []string{url, twitter, instagram} rating = 3 ethnicity = "ethnicity" country = "country" diff --git a/ui/v2.5/src/utils/url.ts b/ui/v2.5/src/utils/url.ts index 3a05bdde5..ee6c0dd36 100644 --- a/ui/v2.5/src/utils/url.ts +++ b/ui/v2.5/src/utils/url.ts @@ -1,14 +1,8 @@ /** * Extracts the sortable portion of a URL by removing the protocol and www. prefix */ -function urlSortKey(url: string): string { - let key = url; - // Remove http:// or https:// - key = key.replace(/^https?:\/\//, ""); - // Remove www. prefix - key = key.replace(/^www\./, ""); - return key.toLowerCase(); -} +const urlSortKey = (url: string): string => + url.toLowerCase().replace(/^(https?:\/\/)?(www\.)?/, ""); /** * Sorts a list of URLs alphabetically by their base URL,