app/models/apidae/apidae_data_parser.rb in apidae-1.4.0 vs app/models/apidae/apidae_data_parser.rb in apidae-1.4.1
- old
+ new
@@ -128,16 +128,18 @@
unless pictures_array.blank?
l = locales.blank? ? [DEFAULT_LOCALE] : locales
l.each do |locale|
pics_data[locale] = []
pictures_array.select { |p| p.is_a?(Hash) && !p[:traductionFichiers].blank? }.each do |pic|
+ pic_file = pic[:traductionFichiers][0]
pics_data[locale] << {
id: pic[:identifiant],
name: localized_value(pic, :nom, locale),
- url: pic[:traductionFichiers][0][:url].gsub('http:', 'https:'),
+ url: pic_file[:url].gsub('http:', 'https:'),
description: localized_value(pic, :legende, locale),
credits: localized_value(pic, :copyright, locale),
- expiration_date: pic[:dateLimiteDePublication] || ''
+ expiration_date: pic[:dateLimiteDePublication] || '',
+ properties: {size: pic_file[:taille], width: pic_file[:largeur], height: pic_file[:height]}
}
end
end
end
{pictures: pics_data}
\ No newline at end of file