From 672192441dd8818941c3b56d74294b237cf15812 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 15 Mar 2023 20:49:01 +0000 Subject: [PATCH] backend: reorder title setting and set title for tags#show --- lib/PoorBooru/Backend/Controller/Gallery.pm | 3 +-- lib/PoorBooru/Backend/Controller/Tags.pm | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/PoorBooru/Backend/Controller/Gallery.pm b/lib/PoorBooru/Backend/Controller/Gallery.pm index ec2b4f6..b1c221d 100644 --- a/lib/PoorBooru/Backend/Controller/Gallery.pm +++ b/lib/PoorBooru/Backend/Controller/Gallery.pm @@ -9,8 +9,6 @@ use SeaweedFS::FID; sub index ($self) { - $self->title("Pooru~"); - my $v = $self->validation; my $page = $v->optional("page")->num(1, undef)->param // 1; @@ -23,6 +21,7 @@ sub index ($self) return $self->render(status => $res->code) if $res->is_error; + $self->title("Pooru~"); my @media = map +{ media_src => $self->seaweed->url_for( SeaweedFS::FID->from_string($_->{seaweedfs_fid}) diff --git a/lib/PoorBooru/Backend/Controller/Tags.pm b/lib/PoorBooru/Backend/Controller/Tags.pm index 9750780..2f080be 100644 --- a/lib/PoorBooru/Backend/Controller/Tags.pm +++ b/lib/PoorBooru/Backend/Controller/Tags.pm @@ -9,8 +9,6 @@ use SeaweedFS::FID; sub list ($self) { - $self->title("tags"); - my $v = $self->validation; my $page = $v->optional("page")->num(1, undef)->param // 1; @@ -21,6 +19,7 @@ sub list ($self) return $self->render(status => $res->code) if $res->is_error; + $self->title("tags"); my @tags = map +{ name => $_->{name}, count => $_->{count}, @@ -36,7 +35,6 @@ sub list ($self) sub show ($self) { - $self->title("tags"); my $v = $self->validation; my $page = $v->optional("page")->num(1, undef)->param // 1; @@ -50,6 +48,7 @@ sub show ($self) return $self->render(status => $res->code) if $res->is_error; + $self->title($res->json->{name}); my @media = map +{ media_src => $self->seaweed->url_for( SeaweedFS::FID->from_string($_->{seaweedfs_fid})