From 5231371100cb598bc92f0a6f3762fa491feba4e8 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 7 Aug 2019 22:11:07 -0500 Subject: [PATCH] posts: drop img.ly source normalization. There are only two posts from this site and the site itself is defunct: * https://danbooru.donmai.us/posts/1561685 * https://danbooru.donmai.us/posts/1412508 * https://img.ly/ofxl --- Gemfile | 1 - Gemfile.lock | 2 -- app/models/post.rb | 6 ------ 3 files changed, 9 deletions(-) diff --git a/Gemfile b/Gemfile index a0d8ba983..a044e5d04 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,6 @@ gem 'statistics2' gem 'capistrano', '~> 3.10' gem 'capistrano-rails' gem 'capistrano-rbenv' -gem 'radix62', '~> 1.0.1' gem 'streamio-ffmpeg' gem 'rubyzip', :require => "zip" gem 'stripe' diff --git a/Gemfile.lock b/Gemfile.lock index ca68c043d..2eeed6a42 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -281,7 +281,6 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - radix62 (1.0.1) rails (5.2.3) actioncable (= 5.2.3) actionmailer (= 5.2.3) @@ -464,7 +463,6 @@ DEPENDENCIES pg pry-byebug ptools - radix62 (~> 1.0.1) rails (~> 5.2) rakismet recaptcha diff --git a/app/models/post.rb b/app/models/post.rb index ea9a4b38e..9586f49fc 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -449,12 +449,6 @@ class Post < ApplicationRecord when %r{\Ahttp://(?:(?:(?:img\d?|cdn)\.)?rule34\.xxx|img\.booru\.org/(?:rule34|r34))(?:/(?:img/rule34|r34))?/{1,2}images/\d+/(?:[a-f0-9]{32}|[a-f0-9]{40})\.}i "https://rule34.xxx/index.php?page=post&s=list&md5=#{md5}" - when %r{\Ahttps?://(?:s3\.amazonaws\.com/imgly_production|img\.ly/system/uploads)/((?:\d{3}/){3}|\d+/)}i - imgly_id = $1 - imgly_id = imgly_id.gsub(/[^0-9]/, '') - base_62 = imgly_id.to_i.encode62 - "https://img.ly/#{base_62}" - when %r{(\Ahttp://.+)/diarypro/d(?:ata/upfile/|iary\.cgi\?mode=image&upfile=)(\d+)}i base_url = $1 entry_no = $2