diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-04-28 19:44:14 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-04-28 19:44:53 -0300 |
| commit | 6c4c1eb9e963aa71a65a7d6f1b2cbdfa0f4416de (patch) | |
| tree | f703c49a0336d2cf80a4f7ebeb53f2c2adc4b28e /src | |
| parent | e6b52c36dc1b705195528f3e1bfaf6e1cbc754d8 (diff) | |
wiki-data: getArtistNumContributions rework preview
Diffstat (limited to 'src')
| -rw-r--r-- | src/common-util/wiki-data.js | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/common-util/wiki-data.js b/src/common-util/wiki-data.js index 14ae8e96..7130b589 100644 --- a/src/common-util/wiki-data.js +++ b/src/common-util/wiki-data.js @@ -211,15 +211,23 @@ export function getAllTracks(albumData) { export function getArtistNumContributions(artist) { return accumulateSum( [ + // Track artist and contributor contributions, to the same track, + // only count for one. unique( - ([ - artist.trackArtistContributions, - artist.trackContributorContributions, - artist.trackCoverArtistContributions, - ]).flat() - .map(({thing}) => thing)), - - artist.albumCoverArtistContributions, + artist.musicContributions + .map(({thing: track}) => track)), + + // Music video artist and contributor contributions, to the same + // music video, only count for one. + unique( + artist.musicVideoContributions + .map(({thing: musicVideo}) => musicVideo)), + + // Contributions to multiple artworks belonging to the same thing count + // as just as many individual contributions. This includes multiple + // artworks for one track, cover and banner for one album, etc. + artist.artworkContributions, + artist.flashContributorContributions, ], ({length}) => length); |