21 lines
800 B
Ruby
21 lines
800 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
|
|
)}"
|
|
# for the UDD
|
|
json.large_image_url "#{request.protocol}#{request.host_with_port}#{screenshot_image_with_id_path(
|
|
p, s.id
|
|
)}"
|
|
end
|
|
end
|