Don't make pixiv http requests when displaying artist history

The reason the urls need to be normalized at all here is because legacy
urls from Danbooru 1 don't have their unnormalized counterparts stored
anywhere and thus can't be accurately compared with unnormalized urls
from Danbooru 2.
This commit is contained in:
Toks
2014-12-09 17:23:44 -05:00
parent e0b0760b39
commit c601253553
2 changed files with 17 additions and 2 deletions

View File

@@ -69,8 +69,8 @@ class ArtistVersion < ActiveRecord::Base
new_urls = url_array
old_urls = version.present? ? version.url_array : []
new_urls = new_urls.map {|url| ArtistUrl.normalize(url)}
old_urls = old_urls.map {|url| ArtistUrl.normalize(url)}
new_urls = new_urls.map {|url| ArtistUrl.legacy_normalize(url)}
old_urls = old_urls.map {|url| ArtistUrl.legacy_normalize(url)}
return {
:added_urls => new_urls - old_urls,