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 $data = decode_json($res->{content});
|
||||||
my @media = map +( {
|
my @media = map +( {
|
||||||
# XXX point to a cache
|
# XXX point to a cache
|
||||||
image_src => $_->{download_uri},
|
image_src => $POORBOORU_API . $_->{download_path},
|
||||||
view_uri => uri_for("/view/" . $_->{id}),
|
view_uri => uri_for("/view/" . $_->{id}),
|
||||||
} ), @{$data->{media}};
|
} ), @{$data->{media}};
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@ get "/tag/:tag_id_or_name" => sub {
|
|||||||
media => [
|
media => [
|
||||||
map +( {
|
map +( {
|
||||||
id => $_,
|
id => $_,
|
||||||
uri => uri_for("/media/$_"),
|
path => "/media/$_",
|
||||||
download_uri => uri_for("/download/$_"),
|
download_path => "/download/$_",
|
||||||
} ), @media,
|
} ), @media,
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@ -93,7 +93,7 @@ get "/media/:media_id" => sub {
|
|||||||
id => $media->media_id,
|
id => $media->media_id,
|
||||||
filename => $media->filename,
|
filename => $media->filename,
|
||||||
size => length($media->content),
|
size => length($media->content),
|
||||||
download_uri => uri_for("/download/" . $media->media_id),
|
download_path => "/download/" . $media->media_id,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user