search: support quoted values for all metatags.

Support using quoted values with all metatags. For example: user:"blah blah",
pool:"blah blah", commentary:"blah blah", etc. Things like rating:"safe",
id:"42" also work. Both single and double quotes are supported.

Also make the status: and rating: metatags fully free. Before only
status:deleted and rating:s were free.
This commit is contained in:
evazion
2020-04-19 02:45:07 -05:00
parent 7726563733
commit 6ca42947bd
3 changed files with 58 additions and 23 deletions

View File

@@ -108,8 +108,8 @@ module Danbooru
end
# Return true if the given tag shouldn't count against the user's tag search limit.
def is_unlimited_tag?(tag)
tag.match?(/\A(-?status:deleted|rating:s.*|limit:.+)\z/i)
def is_unlimited_tag?(term)
term.type == :metatag && term.name.in?(%w[status rating limit])
end
# After this many pages, the paginator will switch to sequential mode.