posts: add is: and has: metatags.
Add the following metatags: * is:parent * is:child * is:safe * is:questionable * is:explicit * is:sfw (same as -rating:q,e) * is:nsfw (same as rating:q,e) * is:active * is:deleted * is:pending * is:flagged * is:appealed * is:banned * is:modqueue * is:unmoderated * is:jpg * is:png * is:gif * is:mp4 * is:webm * is:swf * is:zip * has:parent * has:children * has:source * has:appeals * has:flags * has:replacements * has:comments * has:commentary * has:notes * has:pools All of these searches were already possible with other metatags, but these might be more convenient.
This commit is contained in:
@@ -38,7 +38,7 @@ class PostQueryBuilder
|
||||
ordpool note comment commentary id rating source status filetype
|
||||
disapproved parent child search embedded md5 width height mpixels ratio
|
||||
score upvotes downvotes favcount filesize date age order limit tagcount pixiv_id pixiv
|
||||
unaliased exif duration random
|
||||
unaliased exif duration random is has
|
||||
] + COUNT_METATAGS + COUNT_METATAG_SYNONYMS + CATEGORY_COUNT_METATAGS
|
||||
|
||||
ORDER_METATAGS = %w[
|
||||
@@ -121,6 +121,10 @@ class PostQueryBuilder
|
||||
relation.attribute_matches(value, :tag_count)
|
||||
when "duration"
|
||||
relation.attribute_matches(value, "media_assets.duration", :float).joins(:media_asset)
|
||||
when "is"
|
||||
relation.is_matches(value, current_user)
|
||||
when "has"
|
||||
relation.has_matches(value)
|
||||
when "status"
|
||||
relation.status_matches(value, current_user)
|
||||
when "parent"
|
||||
|
||||
Reference in New Issue
Block a user