Now prepare stream data with imageUrl
This commit is contained in:
parent
5ee1d252fe
commit
b5a727c482
@ -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">
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user