Now prepare stream data with imageUrl

This commit is contained in:
Justin Walrath 2025-05-11 15:29:17 -04:00
parent 5ee1d252fe
commit b5a727c482
2 changed files with 11 additions and 3 deletions

View File

@ -12,7 +12,7 @@ export default function PodcastCard({
return (
<div className="w-full h-[150px] shadow-md rounded-sm overflow-hidden flex m-4 mb-1">
<div className="w-[150px] h-full bg-purple-100 flex-shrink-0 relative">
<Image unoptimized src={imageUrl} alt={title ?? ''} layout="fill" objectFit="cover" />
<Image unoptimized src={imageUrl} alt={title ?? ''} layout="fill" objectFit="contain" />
</div>
<div className="p-4 flex-grow flex flex-col bg-purple-200">

View File

@ -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();