From 1322f423ffcb76ce532ce584b138d648d6b0df95 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 7 Feb 2021 11:05:50 -0400 Subject: don't duplic8 contrib&artist trax on artist pages! if an artist is both an artist and contributor for a track, that track would show up twice on the artist page, and with the exact same line, due to the way the artist track list is constructed. this started happening because we combine the "as contributor" and "as artist" arrays for a given artist, which can have overlap! so now we throw a unique() utility function on top and it works like its supposed to. --- upd8-util.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'upd8-util.js') diff --git a/upd8-util.js b/upd8-util.js index a266efb..b18c052 100644 --- a/upd8-util.js +++ b/upd8-util.js @@ -304,3 +304,5 @@ module.exports.curry = f => x => (...args) => f(x, ...args); module.exports.mapInPlace = (array, fn) => array.splice(0, array.length, ...array.map(fn)); module.exports.filterEmptyLines = string => string.split('\n').filter(line => line.trim()).join('\n'); + +module.exports.unique = arr => Array.from(new Set(arr)); -- cgit 1.3.0-6-gf8a5