fixed nico seiga sources
This commit is contained in:
@@ -6,7 +6,10 @@ class UploadsController < ApplicationController
|
||||
@upload = Upload.new(:rating => "q")
|
||||
if params[:url]
|
||||
@post = Post.find_by_source(params[:url])
|
||||
@source = Sources::Site.new(params[:url])
|
||||
begin
|
||||
@source = Sources::Site.new(params[:url])
|
||||
rescue Exception
|
||||
end
|
||||
end
|
||||
respond_with(@upload)
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ module Sources
|
||||
end
|
||||
|
||||
def get
|
||||
agent.get(URI.parse(url).request_uri) do |page|
|
||||
agent.get(url) do |page|
|
||||
@artist_name, @profile_url = get_profile_from_page(page)
|
||||
@image_url = get_image_url_from_page(page)
|
||||
@tags = get_tags_from_page(page)
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace :images do
|
||||
upload.file_ext = post.file_ext
|
||||
upload.image_width = post.image_width
|
||||
upload.image_height = post.image_height
|
||||
upload.md5 = post.md5
|
||||
upload.generate_resizes(post.file_path)
|
||||
post.distribute_files
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user