mirror of
https://github.com/moebooru/moebooru
synced 2025-09-01 22:45:13 +00:00
filter by file extension
--HG-- branch : moe extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%4018
This commit is contained in:
@@ -62,6 +62,11 @@ module PostSqlMethods
|
||||
cond_params << q[:md5].split(/,/)
|
||||
end
|
||||
|
||||
if q[:ext].is_a?(String)
|
||||
conds << "p.file_ext IN (?)"
|
||||
cond_params << q[:ext].downcase.split(/,/)
|
||||
end
|
||||
|
||||
if q[:deleted_only] == true
|
||||
conds << "p.status = 'deleted'"
|
||||
else
|
||||
|
@@ -56,7 +56,7 @@ module TagParseMethods
|
||||
q = Hash.new {|h, k| h[k] = []}
|
||||
|
||||
scan_query(query).each do |token|
|
||||
if token =~ /^(unlocked|deleted|user|favtag|vote|-vote|fav|md5|-rating|rating|width|height|mpixels|score|source|id|date|pool|-pool|pool_posts|parent|order|change|holds|shown|limit):(.+)$/
|
||||
if token =~ /^(unlocked|deleted|ext|user|favtag|vote|-vote|fav|md5|-rating|rating|width|height|mpixels|score|source|id|date|pool|-pool|pool_posts|parent|order|change|holds|shown|limit):(.+)$/
|
||||
if $1 == "user"
|
||||
q[:user] = $2
|
||||
elsif $1 == "vote"
|
||||
@@ -118,6 +118,8 @@ module TagParseMethods
|
||||
end
|
||||
elsif $1 == "deleted" && $2 == "true"
|
||||
q[:deleted_only] = true
|
||||
elsif $1 == "ext"
|
||||
q[:ext] = $2
|
||||
elsif $1 == "change"
|
||||
q[:change] = parse_helper($2)
|
||||
elsif $1 == "shown"
|
||||
|
Reference in New Issue
Block a user