fixed nico seiga sources

This commit is contained in:
albert
2013-02-19 23:09:07 -05:00
parent 274ef71794
commit 8fb20c6b3a
3 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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