This commit is contained in:
r888888888
2013-05-08 11:48:09 -07:00
parent bb1cbd60f7
commit 09e117049b
2 changed files with 7 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ class Artist < ActiveRecord::Base
u = u.to_escaped_for_sql_like.gsub(/\*/, '%') + '%'
artists += Artist.joins(:urls).where(["artists.is_active = TRUE AND artist_urls.normalized_url LIKE ? ESCAPE E'\\\\'", u]).limit(10).order("artists.name").all
url = File.dirname(url) + "/"
break if url =~ /pixiv\.net\/$/
break if url =~ /pixiv\.net\/(?:img\/)?$/
end
artists.uniq_by {|x| x.name}.slice(0, 20)