api: use tagged_media_view instead of media_tag

This commit is contained in:
Lucas 2023-03-08 20:44:27 +00:00
parent 555a0bc1d1
commit ba099af452

View File

@ -71,12 +71,12 @@ sub show ($self)
status => 404, status => 404,
) if !defined($tag); ) if !defined($tag);
my $paged_media = $self->schema->resultset("MediaTag") my $paged_media = $self->schema->resultset("TaggedMediaView")
->search({ tag_id => $tag->tag_id }, $MEDIA_SEARCH_OPTS) ->search({ tag_id => $tag->tag_id }, $MEDIA_SEARCH_OPTS)
->page($page); ->page($page);
my @media = map +{ my @media = map +{
media_id => $_->media_id, media_id => $_->media_id,
seaweedfs_fid => SeaweedFS::FID->from_bin($_->seaweedfs_fid), seaweedfs_fid => SeaweedFS::FID->from_bin($_->media_seaweedfs_fid),
}, $paged_media->all; }, $paged_media->all;
return $self->render(json => { return $self->render(json => {