posts: add more free metatags.

The following metatags no longer count against the tag search limit:

* is
* id
* date
* age
* filesize
* filetype
* parent
* child
* md5
* width
* height
* duration
* mpixels
* ratio
* score
* upvotes
* downvotes
* favcount
* embedded
* tagcount
* pixiv_id
* pixiv

These are mostly metatags that have to do with properties of the post
itself. Other metatags still count because they involve things like
subqueries or joins, or they're more tag-like in function.
This commit is contained in:
evazion
2022-06-05 13:55:44 -05:00
parent ea92cbff4e
commit 05df3a194c
2 changed files with 7 additions and 2 deletions

View File

@@ -1353,7 +1353,7 @@ class PostQueryBuilderTest < ActiveSupport::TestCase
post1 = create(:post, rating: "s")
assert_raise(PostQuery::TagLimitError) do
PostQuery.search("a b c rating:s width:10 height:10 user:bob", tag_limit: 5)
PostQuery.search("a b c user:bob fav:bob pool:disgustingly_adorable", tag_limit: 5)
end
end
@@ -1363,6 +1363,7 @@ class PostQueryBuilderTest < ActiveSupport::TestCase
assert_tag_match([post1], "aaa bbb rating:s")
assert_tag_match([post1], "aaa bbb status:active")
assert_tag_match([post1], "aaa bbb limit:20")
assert_tag_match([post1], "aaa bbb filesize:<100mb width:<10000 height:<10000 limit:20")
end
should "succeed for exclusive tag searches with no other tag" do