/artists: drop deprecated search syntax, add regex search for names.
Drop support for the following pseudo-metatags in the Name field in the artists search form: * name:<name> * other:<other name> * group:<group name> * status:banned * status:active * http://www.example.com Instead, make the Name field do a wildcard search against the artist name, group name, or other names. If the query looks like `/regex/`, then do a regex search against any of these names. /artists?search[name] now does a literal exact match and /artists?search{any_name_matches] does the above wildcard/regex search.
This commit is contained in:
@@ -409,8 +409,7 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
assert_nil(Artist.other_names_match("artist").first)
|
||||
assert_not_nil(Artist.other_names_match("aaa").first)
|
||||
assert_not_nil(Artist.other_names_match("ccc_ddd").first)
|
||||
assert_not_nil(Artist.search(:name => "other:aaa").first)
|
||||
assert_not_nil(Artist.search(:name => "aaa").first)
|
||||
assert_not_nil(Artist.search(:name => "artist").first)
|
||||
|
||||
assert_not_nil(Artist.search(:other_names_match => "aaa").first)
|
||||
assert_not_nil(Artist.search(:any_name_matches => "aaa").first)
|
||||
@@ -421,7 +420,6 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
yuu = FactoryBot.create(:artist, :name => "yuu", :group_name => "cat_or_fish")
|
||||
cat_or_fish.reload
|
||||
assert_equal("yuu", cat_or_fish.member_names)
|
||||
assert_not_nil(Artist.search(:name => "group:cat_or_fish").first)
|
||||
|
||||
assert_not_nil(Artist.search(:group_name_matches => "cat_or_fish").first)
|
||||
assert_not_nil(Artist.search(:any_name_matches => "cat_or_fish").first)
|
||||
|
||||
Reference in New Issue
Block a user