lib/onebox/engine/pdf_onebox.rb in onebox-1.9.23 vs lib/onebox/engine/pdf_onebox.rb in onebox-1.9.24
- old
+ new
@@ -23,10 +23,10 @@
end
def get_pdf_info
uri = URI.parse(@url)
size = Onebox::Helpers.fetch_content_length(@url)
- return {
+ {
filesize: size ? Onebox::Helpers.pretty_filesize(size.to_i) : nil,
name: File.basename(uri.path)
}
rescue
nil