api: make /tag/:tag_id_or_name return more than media_id

This commit is contained in:
Lucas 2023-03-05 21:08:13 +00:00
parent def852261f
commit b1f2e533c1

View File

@ -74,7 +74,10 @@ sub show ($self)
my $paged_media = $self->schema->resultset("MediaTag")
->search({ tag_id => $tag->tag_id }, $MEDIA_SEARCH_OPTS)
->page($page);
my @media = map { $_->media_id } $paged_media->all;
my @media = map +{
media_id => $_->media_id,
seaweedfs_fid => SeaweedFS::FID->from_bin($_->seaweedfs_fid),
}, $paged_media->all;
return $self->render(json => {
id => $tag->tag_id,