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

10 lines
491 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.url(:thumb, timestamp: false)}"
json.large_image_url "https://#{request.host_with_port}#{s.image.url(:large, timestamp: false)}"
end
end