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) => {
|
export const prepareStreamItem = (stream?: StreamDto) => {
|
||||||
if (!stream) return undefined;
|
if (!stream) return undefined;
|
||||||
|
|
||||||
|
const imageUrl = stream.imageUrl ? convertUrlToPublic(stream.imageUrl) : undefined;
|
||||||
return {
|
return {
|
||||||
...stream,
|
...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 { NextApiRequest, NextApiResponse } from 'next';
|
||||||
import { Podcast } from 'podcast';
|
import { Podcast } from 'podcast';
|
||||||
import { getPodcasts, getStream } from '../../../common/data/db';
|
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(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
res: NextApiResponse
|
res: NextApiResponse
|
||||||
) {
|
) {
|
||||||
const { stream } = req.query,
|
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),
|
items = (await getPodcasts(stream as string)).map(preparePodcastItem),
|
||||||
feed = new Podcast(data);
|
feed = new Podcast(data);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user