lib/rmega/nodes/factory.rb in rmega-0.2.1 vs lib/rmega/nodes/factory.rb in rmega-0.2.2
- old
+ new
@@ -35,10 +35,13 @@
raise "Invalid url or missing file key" unless key
node = if url =~ FOLDER_URL_REGEXP
nodes_data = session.request({a: 'f', c: 1, r: 1}, {n: public_handle})
session.master_key = Utils.base64urldecode(key)
- session.storage.nodes = nodes_data['f'].map { |data| Nodes::Factory.build(session, data) }
+ session.storage.nodes = nodes_data['f'].map do |data|
+ data["__n"] = public_handle
+ Nodes::Factory.build(session, data)
+ end
session.storage.nodes[0]
else
data = session.request(a: 'g', g: 1, p: public_handle)
Nodes::File.new(session, data)
end