#1866: hentai foundry source link redirects
This commit is contained in:
@@ -310,6 +310,9 @@ class Post < ActiveRecord::Base
|
|||||||
when %r{\Ahttp://p\.twpl\.jp/show/orig/([a-z0-9]+)}i
|
when %r{\Ahttp://p\.twpl\.jp/show/orig/([a-z0-9]+)}i
|
||||||
"http://p.twipple.jp/#{$1}"
|
"http://p.twipple.jp/#{$1}"
|
||||||
|
|
||||||
|
when %r{\Ahttp://pictures\.hentai-foundry\.com//a/([^/]+)/(\d+)\.}i
|
||||||
|
"http://www.hentai-foundry.com/pictures/user/#{$1}/#{$2}"
|
||||||
|
|
||||||
else
|
else
|
||||||
source
|
source
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -814,6 +814,11 @@ class PostTest < ActiveSupport::TestCase
|
|||||||
@post.source = "http://p.twpl.jp/show/orig/mI2c3"
|
@post.source = "http://p.twpl.jp/show/orig/mI2c3"
|
||||||
assert_equal("http://p.twipple.jp/mI2c3", @post.normalized_source)
|
assert_equal("http://p.twipple.jp/mI2c3", @post.normalized_source)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "normalize hentai foundry links" do
|
||||||
|
@post.source = "http://pictures.hentai-foundry.com//a/AnimeFlux/219123.jpg"
|
||||||
|
assert_equal("http://www.hentai-foundry.com/pictures/user/AnimeFlux/219123", @post.normalized_source)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user