Yeah, that seems correct. find_entities in Data::EntityTag currently just joins artist to artist_tag and calls _new_from_row in the builder that it passes to query_to_list_limited, so it doesn't get any aliases.
I see aliases if I change find_entities to do something like this:
my ($rows, $hits) = $self->query_to_list_limited($query, [$tag_id], $limit, $offset, sub {
my ($model, $row) = @_;
my $entity = $model->parent->_new_from_row($row);
return MusicBrainz::Server::Entity::AggregatedTag->new(
count => $row->{tt_count},
entity_id => $entity->id,
entity => $entity,
);
});
if ($self->parent->can('load_related_info')) {
my @entities = map { $_->{entity} } @$rows;
$self->parent->load_related_info(\@entities, 'en');
}
($rows, $hits);
Is that desirable (after passing the correct language through)? I don't have a good feel for how expensive it is to do something like this.
I'm also not sure if this should only happen for artists (since that's the only entity type whose load_related_info takes a language and loads aliases, as far as I'm aware).
This also isn't enough to get the alias shown alongside artists in /tag/.../release-group.
Good point! Extended your
MBS-13872to be for both tags and ratings since they're related pages, thanks!