lib/rmega/nodes/file.rb in rmega-0.2.1 vs lib/rmega/nodes/file.rb in rmega-0.2.2
- old
+ new
@@ -3,10 +3,13 @@
class File < Node
include Deletable
include Downloadable
def storage_url
- @storage_url ||= data['g'] || request(a: 'g', g: 1, n: handle)['g']
+ @storage_url ||= begin
+ query_params = data["__n"] ? {n: data["__n"]} : {}
+ data['g'] || request({a: 'g', g: 1, n: handle}, query_params)['g']
+ end
end
def size
data['s']
end