1
Fork 0

Filter out duplicate known links (#10).

This commit is contained in:
Bauke 2022-01-07 22:32:34 +01:00
parent fe76a410a3
commit b0a3b960cc
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 3 additions and 2 deletions

View File

@ -50,8 +50,9 @@ export default class Release {
? `https://coverartarchive.org/release/${mbid}/front-500`
: undefined;
const links = data.relations
.map(({url}) => new RelationLink(url.resource))
const relations = new Set(data.relations.map(({url}) => url.resource));
const links = Array.from(relations)
.map((url) => new RelationLink(url))
.sort((a, b) => a.text.localeCompare(b.text));
return new Release({