lib/hydra/works/services/characterization_service.rb in hydra-works-0.11.0 vs lib/hydra/works/services/characterization_service.rb in hydra-works-0.12.0
- old
+ new
@@ -35,10 +35,11 @@
# @return content of object if source is nil; otherwise, return a File or the source
def source_to_content
return object.content if source.nil?
return File.open(source).read if source.is_a? String
+ source.rewind
source.read
end
def extract_metadata(content)
Hydra::FileCharacterization.characterize(content, file_name, tools) do |cfg|
@@ -97,10 +98,10 @@
term
end
end
def append_property_value(property, value)
- value = object.send(property) + [value]
- object.send("#{property}=", value.uniq)
+ value = object.send(property) + [value] unless property == :mime_type
+ object.send("#{property}=", value)
end
end
end