#2215: update to fix the first case

This commit is contained in:
ghostrigger
2014-07-01 09:14:50 +08:00
parent feb2362a49
commit 40fe8ab9b1

View File

@@ -327,7 +327,7 @@ class Post < ActiveRecord::Base
when %r{\Ahttp://(?:(?:s?img|cdn|www)\d?\.)?gelbooru\.com/{1,2}(?:images|samples)/\d+/(?:sample_)?([a-f0-9]{32})\.}i
"http://gelbooru.com/index.php?page=post&s=list&md5=#{$1}"
when %r{\Ahttps?://(?:slot\d*\.)?im(?:g|ages)\d*\.wikia\.nocookie\.net/(?:_{2}cb\d{14}/)?([^/]+)/images/(?:(?:thumb|archive)?/)?[a-f0-9]/[a-f0-9]{2}/([^/]+)}i
when %r{\Ahttps?://(?:slot\d*\.)?im(?:g|ages)\d*\.wikia\.nocookie\.net/(?:_{2}cb\d{14}/)?([^/]+)(?:/[a-z]{2})?/images/(?:(?:thumb|archive)?/)?[a-f0-9]/[a-f0-9]{2}/([^/]+)}i
subdomain = $1
filename = $2
"http://#{subdomain}.wikia.com/wiki/File:#{filename}"