fixes #1149
This commit is contained in:
@@ -157,6 +157,8 @@ class PostQueryBuilder
|
||||
if q[:source]
|
||||
if q[:source] == "none%"
|
||||
relation = relation.where("(posts.source = '' OR posts.source IS NULL)")
|
||||
elsif q[:source] == "http%"
|
||||
relation = relation.where("(posts.source like ?)", "http%")
|
||||
elsif q[:source] =~ /^%\.?pixiv(?:\.net(?:\/img)?)?(?:%\/|(?=%$))(.+)$/
|
||||
relation = relation.where("SourcePattern(posts.source) LIKE ? ESCAPE E'\\\\'", "pixiv/" + $1)
|
||||
has_constraints!
|
||||
|
||||
@@ -114,7 +114,7 @@ class Artist < ActiveRecord::Base
|
||||
Artist.new.tap do |artist|
|
||||
if params[:name]
|
||||
artist.name = params[:name]
|
||||
post = Post.tag_match("source:http* #{artist.name}").first
|
||||
post = Post.tag_match("source:http #{artist.name}").first
|
||||
unless post.nil? || post.source.blank?
|
||||
artist.url_string = post.source
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user