From 66b90163ce2c69ee3f4f2f39fd1c8973840f4996 Mon Sep 17 00:00:00 2001 From: Brett Higgins Date: Tue, 27 Apr 2021 08:34:05 -0400 Subject: [PATCH] Only sync published podcasts --- src/sync.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sync.js b/src/sync.js index df650d4..3c4fe00 100644 --- a/src/sync.js +++ b/src/sync.js @@ -23,8 +23,10 @@ async function getPodcasts(environment) { content_type: 'podcast', }); - // just the ones with a public feed - return response.items.filter(p => _.get(p.fields, 'feedUrl')); + // just the published entries with a public feed + return response.items.filter( + p => (_.get(p.fields, 'feedUrl') && _.get(p.sys, 'publishedAt')) + ); } async function getSeasons(environment, podcast) {