Filter out defunct platforms (#11).
This commit is contained in:
parent
d4d9a8b0f0
commit
319a352d2e
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue