Skip to content

Commit

Permalink
Merge pull request #3075 from metabrainz/artist-search-disambiguation
Browse files Browse the repository at this point in the history
LB-1707: Add sort name and disambiguation in artist search pages
  • Loading branch information
anshg1214 authored Dec 13, 2024
2 parents 62b8a87 + c57a654 commit 7e5991b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frontend/js/src/search/ArtistSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ export default function ArtistSearch(props: ArtistSearchProps) {
<tr key={artist?.id}>
<td>{(currPageNo - 1) * ARTIST_COUNT_PER_PAGE + index + 1}</td>
<td>
<Link to={`/artist/${artist?.id}/`}>{artist?.name}</Link>
<Link
to={`/artist/${artist?.id}/`}
title={`(${artist["sort-name"]}${
artist?.disambiguation ? `, ${artist.disambiguation}` : ""
})`}
>
{artist?.name}
</Link>
{artist?.disambiguation && (
<small>&nbsp;({artist.disambiguation})</small>
)}
</td>
<td>{artist?.type}</td>
<td>{_.capitalize(artist?.gender)}</td>
Expand Down
14 changes: 14 additions & 0 deletions frontend/js/src/search/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ type TrackTypeSearchResult = {
}[];
};

type Alias = {
"sort-name": string;
"type-id": string;
name: string;
locale: string | null;
type: string;
primary: boolean | null;
"begin-date": number | null;
"end-date": number | null;
};

type ArtistTypeSearchResult = {
count: number;
offset: number;
Expand All @@ -51,9 +62,12 @@ type ArtistTypeSearchResult = {
type?: string;
country?: string;
gender?: string;
"sort-name"?: string;
disambiguation?: string;
area?: {
name: string;
};
aliases?: Alias[];
}[];
};

Expand Down

0 comments on commit 7e5991b

Please sign in to comment.