api: return paths instead of URIs
This commit is contained in:
parent
ead5728a99
commit
46cb5c19ec
@ -63,7 +63,7 @@ get "/tag/:tag_id_or_name" => sub {
|
||||
my $data = decode_json($res->{content});
|
||||
my @media = map +( {
|
||||
# XXX point to a cache
|
||||
image_src => $_->{download_uri},
|
||||
image_src => $POORBOORU_API . $_->{download_path},
|
||||
view_uri => uri_for("/view/" . $_->{id}),
|
||||
} ), @{$data->{media}};
|
||||
|
||||
|
@ -66,9 +66,9 @@ get "/tag/:tag_id_or_name" => sub {
|
||||
name => $tag->name,
|
||||
media => [
|
||||
map +( {
|
||||
id => $_,
|
||||
uri => uri_for("/media/$_"),
|
||||
download_uri => uri_for("/download/$_"),
|
||||
id => $_,
|
||||
path => "/media/$_",
|
||||
download_path => "/download/$_",
|
||||
} ), @media,
|
||||
],
|
||||
};
|
||||
@ -90,10 +90,10 @@ get "/media/:media_id" => sub {
|
||||
send_error("Media not found", 404) if !defined($media);
|
||||
|
||||
return {
|
||||
id => $media->media_id,
|
||||
filename => $media->filename,
|
||||
size => length($media->content),
|
||||
download_uri => uri_for("/download/" . $media->media_id),
|
||||
id => $media->media_id,
|
||||
filename => $media->filename,
|
||||
size => length($media->content),
|
||||
download_path => "/download/" . $media->media_id,
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user