From b5a727c4824f670178e3af200d66505e554cbb76 Mon Sep 17 00:00:00 2001 From: Justin Walrath Date: Sun, 11 May 2025 15:29:17 -0400 Subject: [PATCH] Now prepare stream data with imageUrl --- src/app/[stream]/podcasts/podcastCard.tsx | 2 +- src/common/helpers/data.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/[stream]/podcasts/podcastCard.tsx b/src/app/[stream]/podcasts/podcastCard.tsx index 96c5baf..9deb4f9 100644 --- a/src/app/[stream]/podcasts/podcastCard.tsx +++ b/src/app/[stream]/podcasts/podcastCard.tsx @@ -12,7 +12,7 @@ export default function PodcastCard({ return (
- {title + {title
diff --git a/src/common/helpers/data.ts b/src/common/helpers/data.ts index b606205..f7d17ee 100644 --- a/src/common/helpers/data.ts +++ b/src/common/helpers/data.ts @@ -3,6 +3,7 @@ import os from 'os'; import path from 'path'; import mime from 'mime-types'; import { PodcastDto } from '../dtos/podcastDto'; +import { StreamDto } from '../dtos/streamDto'; export const getFileSize = (filePath: string): number => { const stats = fs.statSync(filePath); @@ -32,8 +33,15 @@ export const preparePodcastItem = (podcast: PodcastDto) => { type: getFileMimeType(podcast.url ?? ''), size: fileSize } - } -} + }; +}; + +export const prepareStreamItem = (stream: StreamDto) => { + return { + ...stream, + imageUrl: convertUrlToPublic(stream.imageUrl) + }; +}; export const getLocalIpAddress = (): string => { const networkInterfaces = os.networkInterfaces();