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,