Updated the podcast rss feed to throw the full image url into imageUrl
This commit is contained in:
parent
0e36d23bb4
commit
5676477b18
@ -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 }
|
||||
// ]
|
||||
// }
|
||||
//]
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user