Filter out discography entries from the known link candidates.
This commit is contained in:
parent
67457393d6
commit
e3faf966df
|
@ -10,6 +10,7 @@ type ApiReleaseData = {
|
||||||
};
|
};
|
||||||
id: string;
|
id: string;
|
||||||
relations: Array<{
|
relations: Array<{
|
||||||
|
type: string;
|
||||||
url: {
|
url: {
|
||||||
resource: string;
|
resource: string;
|
||||||
};
|
};
|
||||||
|
@ -50,7 +51,11 @@ export default class Release {
|
||||||
? `https://coverartarchive.org/release/${mbid}/front-500`
|
? `https://coverartarchive.org/release/${mbid}/front-500`
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
const relations = new Set(data.relations.map(({url}) => url.resource));
|
const relations = new Set(
|
||||||
|
data.relations
|
||||||
|
.filter((relation) => relation.type !== 'discography entry')
|
||||||
|
.map((relation) => relation.url.resource),
|
||||||
|
);
|
||||||
const links = Array.from(relations)
|
const links = Array.from(relations)
|
||||||
.map((url) => new RelationLink(url))
|
.map((url) => new RelationLink(url))
|
||||||
.sort((a, b) => a.text.localeCompare(b.text));
|
.sort((a, b) => a.text.localeCompare(b.text));
|
||||||
|
|
Loading…
Reference in New Issue