From f2c3729f6be32156a0d7187d9c5efc9dc4973386 Mon Sep 17 00:00:00 2001 From: Jake Cahill <45230295+JakeSCahill@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:36:13 +0100 Subject: [PATCH] Do not publish private or maintenance tracks --- scripts/index-masterclasses/index-masterclasses.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/index-masterclasses/index-masterclasses.js b/scripts/index-masterclasses/index-masterclasses.js index 71bf6fa..219a5cd 100644 --- a/scripts/index-masterclasses/index-masterclasses.js +++ b/scripts/index-masterclasses/index-masterclasses.js @@ -66,7 +66,9 @@ const client = new GraphQLClient('https://play.instruqt.com/graphql', { async function fetchTracks() { try { const data = await client.request(GET_TRACKS_QUERY); - return data.tracks; + // Filter out tracks that are private or in maintenance mode + const filteredTracks = data.tracks.filter(track => !track.private && !track.maintenance); + return filteredTracks; } catch (error) { console.error('Error fetching tracks:', error); return [];