I'm facing some challenges filtering a .json file to exclude private videos on an app related to a YouTube channel. There are certain videos marked as private that I do not want to display within the app. Can someone assist me in properly filtering the .json data?
Currently, when utilizing the code snippet below to filter the data, it returns an empty json object. However, if I remove the .map function, it displays the complete list of videos including the private ones.
getPlayListVideos(listId: string) {
return this.http.get('https://www.googleapis.com/youtube/v3/playlistItems?key=' + this.apiKey + '&fields=items/snippet/resourceId/videoId,items/snippet/publishedAt,items/snippet/title,items/snippet/thumbnails/high/url&playlistId=' + listId +'&part=snippet,id&maxResults=25')
.map((res) => {
return res.json()['items'].filter(item => {
if(item.snippet.title === 'Private video'){
return false;
}
});
})
}