Chapters (from podcast 2.0 spec) #11

Merged
olaven merged 3 commits from feat/podcast-2.0-compliancy into main 2023-03-21 07:59:07 +00:00
1 changed files with 5 additions and 1 deletions
Showing only changes of commit d0031903c2 - Show all commits

View File

@ -14,8 +14,12 @@ export const handler = async (req: Request, _ctx: HandlerContext): Promise<Respo
console.log("going to get ep for ", episodeId);
const episode = await nrkRadio.getEpisode(seriesId, episodeId);
const chapters = toChapters(episode);
const body = {
version: "1.2.0",
chapters,
}
return new Response(JSON.stringify(chapters), {
return new Response(JSON.stringify(body), {
headers: {
"Content-Type": "application/json+chapters"
}