Updated the podcast rss feed to throw the full image url into imageUrl

This commit is contained in:
Justin Walrath 2025-05-11 20:59:51 -04:00
parent 0e36d23bb4
commit 5676477b18
2 changed files with 14 additions and 3 deletions

View File

@ -38,9 +38,20 @@ export const preparePodcastItem = (podcast: PodcastDto) => {
export const prepareStreamItem = (stream?: StreamDto) => {
if (!stream) return undefined;
const imageUrl = stream.imageUrl ? convertUrlToPublic(stream.imageUrl) : undefined;
return {
...stream,
imageUrl: convertUrlToPublic(stream.imageUrl)
imageUrl//,
// customElements: [
// {
// image: [
// { url: imageUrl },
// { title: stream.title }//,
// //{ link: stream.link }
// ]
// }
//]
};
};

View File

@ -1,14 +1,14 @@
import { NextApiRequest, NextApiResponse } from 'next';
import { Podcast } from 'podcast';
import { getPodcasts, getStream } from '../../../common/data/db';
import { preparePodcastItem } from '../../../common/helpers/data';
import { preparePodcastItem, prepareStreamItem } from '../../../common/helpers/data';
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const { stream } = req.query,
data = await getStream(stream as string),
data = prepareStreamItem(await getStream(stream as string)),
items = (await getPodcasts(stream as string)).map(preparePodcastItem),
feed = new Podcast(data);