Skip to content

Commit

Permalink
Only sync published podcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
brettdh committed Apr 27, 2021
1 parent a38100e commit 66b9016
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 66b9016

Please sign in to comment.