another bug fix for nico seiga artist url normalization
This commit is contained in:
@@ -41,7 +41,7 @@ module Sources
|
|||||||
end
|
end
|
||||||
|
|
||||||
def normalized_for_artist_finder?
|
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
|
end
|
||||||
|
|
||||||
def normalizable_for_artist_finder?
|
def normalizable_for_artist_finder?
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
||||||
|
|
||||||
ActiveRecord::Base.without_timeout do
|
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
|
before = url.normalized_url
|
||||||
url.normalize!
|
url.normalize
|
||||||
puts "#{before} -> #{url.normalized_url}" if before != url.normalized_url
|
puts "#{before} -> #{url.normalized_url}" if before != url.normalized_url unless ArtistUrl.where(normalized_url: url.normalized_url).exists?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user