diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-05-01 08:02:48 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-05-01 08:02:48 -0300 |
| commit | dba7bea5c4ef2499c3cc0aee2a3154f6a31ea5b2 (patch) | |
| tree | 5d0e0c40474d740fc1c77f9fbb79183a748570a1 /src | |
| parent | 5b000531ea5b7f770c1d763c85020c3314b89673 (diff) | |
wiki-data: getArtistNumContributions: consider countInContributionTotals
Diffstat (limited to 'src')
| -rw-r--r-- | src/common-util/wiki-data.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common-util/wiki-data.js b/src/common-util/wiki-data.js index 7130b589..f47a48ff 100644 --- a/src/common-util/wiki-data.js +++ b/src/common-util/wiki-data.js @@ -209,26 +209,32 @@ export function getAllTracks(albumData) { } export function getArtistNumContributions(artist) { + const keep = contrib => contrib.countInContributionTotals; + return accumulateSum( [ // Track artist and contributor contributions, to the same track, // only count for one. unique( artist.musicContributions + .filter(keep) .map(({thing: track}) => track)), // Music video artist and contributor contributions, to the same // music video, only count for one. unique( artist.musicVideoContributions + .filter(keep) .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.artworkContributions + .filter(keep), - artist.flashContributorContributions, + artist.flashContributorContributions + .filter(keep), ], ({length}) => length); } |