another bug fix for nico seiga artist url normalization

This commit is contained in:
r888888888
2017-05-31 15:50:40 -07:00
parent 6a706a6b90
commit 09ed1ea720
2 changed files with 4 additions and 4 deletions

View File

@@ -41,7 +41,7 @@ module Sources
end
def normalized_for_artist_finder?
url =~ %r!https?://seiga\.nicovideo\.jp/user/illust/\d+!i
url =~ %r!https?://seiga\.nicovideo\.jp/user/illust/\d+/!i
end
def normalizable_for_artist_finder?

View File

@@ -3,9 +3,9 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
ActiveRecord::Base.without_timeout do
ArtistUrl.where("normalized_url like ?", "\%nico\%").find_each do |url|
ArtistUrl.where("normalized_url like ?", "\%nicovideo\%").find_each do |url|
before = url.normalized_url
url.normalize!
puts "#{before} -> #{url.normalized_url}" if before != url.normalized_url
url.normalize
puts "#{before} -> #{url.normalized_url}" if before != url.normalized_url unless ArtistUrl.where(normalized_url: url.normalized_url).exists?
end
end