Commit c3bc96c2 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey

fix bitstream retrieve file name

parent 5375430f
......@@ -56,7 +56,16 @@ module Dspace
def retrieve(args={})
bitstreams_path = args.fetch(:bitstreams_path, nil)
bitstream = ResourceKit::ActionInvoker.call(action(:find), self, id: args.fetch(:id))
Dspace::Builders::TempfileBuilder.build(bitstream.name, ResourceKit::ActionInvoker.call(action(:retrieve), self, id: bitstream.id), bitstreams_path)
return nil if bitstream.is_a? String
Dspace::Builders::TempfileBuilder.build(bitstream_filename(bitstream), ResourceKit::ActionInvoker.call(action(:retrieve), self, id: bitstream.id), bitstreams_path)
end
private
def bitstream_filename(bitstream)
name = bitstream.try(:name)
name = bitstream.id.to_s if !name || name.empty?
name
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment