diff --git a/lib/PoorBooru.pm b/lib/PoorBooru.pm index 0a46ec6..187bc47 100644 --- a/lib/PoorBooru.pm +++ b/lib/PoorBooru.pm @@ -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}}; diff --git a/lib/PoorBooru/API/V0.pm b/lib/PoorBooru/API/V0.pm index 787a3ae..1977cb9 100644 --- a/lib/PoorBooru/API/V0.pm +++ b/lib/PoorBooru/API/V0.pm @@ -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, }; };