debshots/app/views/json/screenshots.json.jbuilder

10 lines
503 B
Ruby

json.cache! ['json_screenshots'], expires_in: 1.hour do
json.screenshots @s do |s|
p = s.package
json.extract! s, :version
json.extract! p, :maintainer, :name, :section, :maintainer_email, :homepage, :description
json.url package_url(p.name, protocol: 'https')
json.small_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: [160,120])}"
json.large_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: [800,600])}"
end
end