api: always return a list of media_ids
This commit is contained in:
parent
0876464b5b
commit
216422f50a
@ -63,8 +63,8 @@ get "/tag/:tag_id_or_name" => sub {
|
||||
my $data = decode_json($res->{content});
|
||||
my @media = map +( {
|
||||
# XXX point to a cache
|
||||
image_src => $POORBOORU_API . $_->{download_path},
|
||||
view_uri => uri_for("/view/" . $_->{id}),
|
||||
image_src => "$POORBOORU_API/download/$_",
|
||||
view_uri => uri_for("/view/$_"),
|
||||
} ), @{$data->{media}};
|
||||
|
||||
template "gallery" => {
|
||||
|
@ -73,13 +73,7 @@ get "/tag/:tag_id_or_name" => sub {
|
||||
return {
|
||||
id => $tag->tag_id,
|
||||
name => $tag->name,
|
||||
media => [
|
||||
map +( {
|
||||
id => $_,
|
||||
path => "/media/$_",
|
||||
download_path => "/download/$_",
|
||||
} ), @media,
|
||||
],
|
||||
media => \@media,
|
||||
};
|
||||
};
|
||||
|
||||
@ -92,7 +86,7 @@ get "/media" => sub {
|
||||
->page($page);
|
||||
|
||||
my ($prev, $next) = surrounding_pages($paged_media);
|
||||
my @media = map { "/media/" . $_->media_id } $paged_media->all;
|
||||
my @media = map { $_->media_id } $paged_media->all;
|
||||
|
||||
return {
|
||||
next => ($next and "/media?page=$next"),
|
||||
|
Loading…
Reference in New Issue
Block a user