diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-04-14 20:26:02 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-04-14 20:26:02 -0300 |
| commit | 2336e252d25536d3678119ff070189e666b98927 (patch) | |
| tree | 788b9c689b8c7ac4324af092c73e95f20b5abd6f /src/common-util | |
| parent | ed38f9529084cdd3ff6cdfb56148fd9a99c259b2 (diff) | |
content, data: generateArtistInfoPageMusicVideosChunkedList
Diffstat (limited to 'src/common-util')
| -rw-r--r-- | src/common-util/wiki-data.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/common-util/wiki-data.js b/src/common-util/wiki-data.js index 54f8b7ed..14ae8e96 100644 --- a/src/common-util/wiki-data.js +++ b/src/common-util/wiki-data.js @@ -280,6 +280,55 @@ export function chunkArtistTrackContributions(contributions) { ]))); } +// Ditto. More shared logic for the artist page. +export function selectRepresentativeArtistContributorContribs(contribs) { + const creditedAsNormalArtist = + contribs + .some(contrib => + contrib.thingProperty === 'artistContribs' && + !contrib.isFeaturingCredit); + + const creditedAsContributor = + contribs + .some(contrib => contrib.thingProperty === 'contributorContribs'); + + const annotatedContribs = + contribs + .filter(contrib => !empty(contrib.annotationParts)); + + const annotatedArtistContribs = + annotatedContribs + .filter(contrib => contrib.thingProperty === 'artistContribs'); + + const annotatedContributorContribs = + annotatedContribs + .filter(contrib => contrib.thingProperty === 'contributorContribs'); + + // Don't display annotations associated with crediting in the + // Contributors field if the artist is also credited as an Artist + // *and* the Artist-field contribution is non-annotated. This is + // so that we don't misrepresent the artist - the contributor + // annotation tends to be for "secondary" and performance roles. + // For example, this avoids crediting Marcy Nabors on Renewed + // Return seemingly only for "bass clarinet" when they're also + // the one who composed and arranged Renewed Return! + if ( + creditedAsNormalArtist && + creditedAsContributor && + empty(annotatedArtistContribs) + ) { + return null; + } else if ( + !empty(annotatedArtistContribs) || + !empty(annotatedContributorContribs) + ) { + return [ + ...annotatedArtistContribs, + ...annotatedContributorContribs, + ]; + } +} + // Big-ass homepage row functions export function getNewAdditions(numAlbums, {albumData}) { |