no longer require presence of ugoira tag to process ugoira posts

This commit is contained in:
r888888888
2014-10-23 16:34:31 -07:00
parent c9ee4f242f
commit 981e6dab67
4 changed files with 11 additions and 12 deletions

View File

@@ -14,7 +14,7 @@ module Downloads
@file_path = file_path
# we sometimes need to capture data from the source page
@data = {:is_ugoira => options[:is_ugoira]}
@data = {}
end
def download!

View File

@@ -18,6 +18,7 @@ module Downloads
# http://i2.pixiv.net/img-zip-ugoira/img/2014/08/05/06/01/10/44524589_ugoira1920x1080.zip
if url =~ %r!\Ahttps?://i\d+\.pixiv\.net/img-zip-ugoira/img/\d{4}/\d{2}/\d{2}/\d{2}/\d{2}/\d{2}/\d+_ugoira\d+x\d+\.zip\z!i
data[:is_ugoira] = true
data[:ugoira_frame_data] = source.ugoira_frame_data
data[:ugoira_width] = source.ugoira_width
data[:ugoira_height] = source.ugoira_height

View File

@@ -19,9 +19,11 @@ class PixivUgoiraService
end
def load(data)
@frame_data = data[:ugoira_frame_data]
@width = data[:ugoira_width]
@height = data[:ugoira_height]
@content_type = data[:ugoira_content_type]
if data[:is_ugoira]
@frame_data = data[:ugoira_frame_data]
@width = data[:ugoira_width]
@height = data[:ugoira_height]
@content_type = data[:ugoira_content_type]
end
end
end