posts: fix incorrect post counts for -pool:, -fav: searches

Fix `-pool:1234` and `-fav:evazion` searches incorrectly returning the
same post count as `pool:1234` and `fav:evazion` searches.
This commit is contained in:
evazion
2022-08-28 22:50:33 -05:00
parent fa0d7990fb
commit 4448b3d15b
2 changed files with 13 additions and 6 deletions

View File

@@ -111,12 +111,12 @@ class PostQuery
ast.none?
end
# True if the search is a single metatag search for the given metatag.
# True if the search is a single, non-negated metatag search for the given metatag. Assumes the query has been normalized.
def is_metatag?(name, value = nil)
if value.nil?
is_single_term? && has_metatag?(name)
metatag? && has_metatag?(name)
else
is_single_term? && find_metatag(name) == value.to_s
metatag? && find_metatag(name) == value.to_s
end
end