fix: filter out docs that don't match podcast episodes
This commit is contained in:
parent
3363b15587
commit
584d4535ca
|
@ -22,7 +22,7 @@ export const PodcastEpisodeDataType: UnbodyDataTypeConfig<
|
|||
isMatch: (helpers, data, original) =>
|
||||
original
|
||||
? original.pathString.includes('/Podcasts/') &&
|
||||
original.slug.startsWith('ep')
|
||||
/^ep\d+-\d{8}-.*/.test(original.slug)
|
||||
: false,
|
||||
|
||||
transform: async (helpers, data, original, root, context) => {
|
||||
|
@ -97,7 +97,6 @@ export const PodcastEpisodeDataType: UnbodyDataTypeConfig<
|
|||
coverImage,
|
||||
show,
|
||||
showId: show?.id,
|
||||
featured: data.featured,
|
||||
highlighted: data.highlighted,
|
||||
type: LPE.PostTypes.Podcast,
|
||||
}
|
||||
|
|
|
@ -519,12 +519,14 @@ export class UnbodyService {
|
|||
shows = [...data]
|
||||
}
|
||||
|
||||
return unbodyDataTypes.transformMany<LPE.Podcast.Document>(
|
||||
podcastEpisodeDocument,
|
||||
docs,
|
||||
undefined,
|
||||
{ shows, parseContent },
|
||||
)
|
||||
return unbodyDataTypes
|
||||
.transformMany<LPE.Podcast.Document>(
|
||||
podcastEpisodeDocument,
|
||||
docs,
|
||||
undefined,
|
||||
{ shows, parseContent },
|
||||
)
|
||||
.then((res) => res.filter((obj) => obj && obj.type === 'podcast'))
|
||||
}, [])
|
||||
|
||||
getPodcastEpisode = ({
|
||||
|
|
Loading…
Reference in New Issue