Skip to content

Commit

Permalink
💩 NICE-63 notion api killing me [b] (#1728)
Browse files Browse the repository at this point in the history
since no new episodes are
 being recorded - just hard-code the XML
turn off the dynamic generation on the API RSS for now
 and _do_ pass the staticPaths for generation
  • Loading branch information
JeromeFitz authored Jul 17, 2023
1 parent 80ef0b4 commit 28c7697
Show file tree
Hide file tree
Showing 8 changed files with 1,364 additions and 255 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ async function _generateStaticParams({ ...props }) {

console.dir(`> generateStaticParams (${SEGMENT})`)
const segmentInfo = getSegmentInfo({ SEGMENT, ...props })
// const data = await getDataFromCache({
// database_id: '',
// filterType: 'equals',
// segmentInfo,
// })
const dataStatic: QueryDatabaseResponse = await getDatabaseQuery({
database_id: DATABASE_ID,
draft: false,
Expand All @@ -100,8 +95,6 @@ async function _generateStaticParams({ ...props }) {
const { properties } = item
const { isPublished } = getPodcastData(properties)
if (!isPublished) return
// const propertyTypeData: any = getPropertyTypeData(properties, 'Slug.Preview')
// const href = propertyTypeData?.string.replaceAll(`/${SEGMENT}/`, '')
const href = getPropertyTypeData(properties, 'Slug.Preview')?.replaceAll(
`/${SEGMENT}/`,
''
Expand All @@ -114,6 +107,20 @@ async function _generateStaticParams({ ...props }) {
element.length > 0 && combos.push({ catchAll: element })
}
}
const { episodeSlugs, ...props } = getPodcastData(properties)
episodeSlugs.map((slug) => {
const href = `${props.href}/${slug}`
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const catchAll = href.replaceAll(`/${SEGMENT}/`, '').split('/')
segments.push({ catchAll })
if (catchAll.length > 0) {
for (let index = 0; index < catchAll.length; index++) {
const element = catchAll.slice(0, index)
element.length > 0 && combos.push({ catchAll: element })
}
}
})
})
}
// const routes = !!combos && uniqWith(combos, isEqual)
Expand Down
222 changes: 0 additions & 222 deletions sites/jerandky.com/src/app/api/rss/podcasts/[slug]/route.ts

This file was deleted.

Loading

0 comments on commit 28c7697

Please sign in to comment.