1
Fork 0

Filter out defunct platforms (#11).

This commit is contained in:
Bauke 2022-01-11 12:40:30 +01:00
parent d4d9a8b0f0
commit 319a352d2e
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 7 additions and 1 deletions

View File

@ -10,6 +10,7 @@ type ApiReleaseData = {
}; };
id: string; id: string;
relations: Array<{ relations: Array<{
ended: boolean;
type: string; type: string;
url: { url: {
resource: string; resource: string;
@ -53,7 +54,12 @@ export default class Release {
const relations = new Set( const relations = new Set(
data.relations data.relations
.filter((relation) => relation.type !== 'discography entry') // Remove discography entries and links that have been marked as no
// longer working.
.filter(
(relation) =>
relation.type !== 'discography entry' && !relation.ended,
)
.map((relation) => relation.url.resource), .map((relation) => relation.url.resource),
); );
const links = Array.from(relations) const links = Array.from(relations)