debshots/app/views/json/screenshots.json.jbuilder
2026-02-04 00:15:05 +01:00

17 lines
657 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.thumb_image_url "#{request.protocol}#{request.host_with_port}#{thumbnail_with_id_path(
p, s.id
)}"
json.small_image_url "#{request.protocol}#{request.host_with_port}#{small_image_with_id_path(
p, s.id
)}"
json.screenshot_image_url "#{request.protocol}#{request.host_with_port}#{screenshot_image_with_id_path(
p, s.id
)}"
end
end