From 171c6ee8cdced18adea5ac07cf31d7a06821ef65 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 17 Mar 2023 20:57:08 +0000 Subject: [PATCH] backend: link to /media/:media_id instead of raw image --- lib/PoorBooru/Backend/Controller/Media.pm | 3 ++- lib/PoorBooru/Backend/Controller/Tags.pm | 3 ++- templates/gallery.html.ep | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/PoorBooru/Backend/Controller/Media.pm b/lib/PoorBooru/Backend/Controller/Media.pm index cfceae7..d0f6b3d 100644 --- a/lib/PoorBooru/Backend/Controller/Media.pm +++ b/lib/PoorBooru/Backend/Controller/Media.pm @@ -23,7 +23,8 @@ sub list ($self) $self->title("Pooru~"); my @media = map +{ - media_src => $self->seaweed->url_for( + media_link => $self->url_for("media_show", media_id => $_->{media_id}), + media_src => $self->seaweed->url_for( SeaweedFS::FID->from_string($_->{seaweedfs_fid}) ), }, @{$res->json->{media}}; diff --git a/lib/PoorBooru/Backend/Controller/Tags.pm b/lib/PoorBooru/Backend/Controller/Tags.pm index 6cdee89..c3cdc3a 100644 --- a/lib/PoorBooru/Backend/Controller/Tags.pm +++ b/lib/PoorBooru/Backend/Controller/Tags.pm @@ -50,7 +50,8 @@ sub show ($self) $self->title($res->json->{name}); my @media = map +{ - media_src => $self->seaweed->url_for( + media_link => $self->url_for("media_show", media_id => $_->{media_id}), + media_src => $self->seaweed->url_for( SeaweedFS::FID->from_string($_->{seaweedfs_fid}) ), }, @{$res->json->{media}}; diff --git a/templates/gallery.html.ep b/templates/gallery.html.ep index a2f0733..0a80668 100644 --- a/templates/gallery.html.ep +++ b/templates/gallery.html.ep @@ -2,7 +2,7 @@