testing
This commit is contained in:
@@ -5,7 +5,7 @@ class UploadService
|
||||
|
||||
if Utils.is_downloadable?(url) && file.nil?
|
||||
download = Downloads::File.new(url)
|
||||
normalized_url, _, _ = download.before_download(url, {})
|
||||
normalized_url = download.rewrite_url()
|
||||
post = if normalized_url.nil?
|
||||
Post.where("SourcePattern(lower(posts.source)) = ?", url).first
|
||||
else
|
||||
|
||||
@@ -222,7 +222,8 @@ class UploadService
|
||||
def download_for_upload(source, upload)
|
||||
file = download_from_source(source, referer_url: upload.referer_url) do |context|
|
||||
upload.downloaded_source = context[:downloaded_source]
|
||||
upload.source = context[:source]
|
||||
puts "source: #{source} -> #{context[:source]}"
|
||||
#upload.source = context[:source]
|
||||
|
||||
if context[:ugoira]
|
||||
upload.context = { ugoira: context[:ugoira] }
|
||||
|
||||
@@ -115,7 +115,7 @@ class ArtistUrl < ApplicationRecord
|
||||
|
||||
def validate_url_format
|
||||
uri = Addressable::URI.parse(url)
|
||||
errors[:url] << " #{uri} must begin with http:// or https://" if !uri.scheme.in?(%w[http https])
|
||||
errors[:url] << "#{uri} must begin with http:// or https://" if !uri.scheme.in?(%w[http https])
|
||||
rescue Addressable::URI::InvalidURIError => error
|
||||
errors[:url] << "is malformed: #{error}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user