diff --git a/components/downloads/ActiveDownloads.tsx b/components/downloads/ActiveDownloads.tsx index 89380775..25f9fcf4 100644 --- a/components/downloads/ActiveDownloads.tsx +++ b/components/downloads/ActiveDownloads.tsx @@ -82,8 +82,15 @@ export const ActiveDownloads: React.FC = ({ ...props }) => { {p.item.Name} {p.item.Type} - - {p.progress.toFixed(0)}% + + + {p.progress.toFixed(0)}% + + {p.speed && ( + + {p.speed.toFixed(2)}% + + )} {p.state} diff --git a/hooks/useRemuxHlsToMp4.ts b/hooks/useRemuxHlsToMp4.ts index 9ec784b2..07978337 100644 --- a/hooks/useRemuxHlsToMp4.ts +++ b/hooks/useRemuxHlsToMp4.ts @@ -65,6 +65,7 @@ export const useRemuxHlsToMp4 = (item: BaseItemDto) => { const fps = item.MediaStreams?.[0]?.RealFrameRate || 25; const totalFrames = videoLength * fps; const processedFrames = statistics.getVideoFrameNumber(); + const speed = statistics.getSpeed(); const percentage = totalFrames > 0 @@ -74,6 +75,7 @@ export const useRemuxHlsToMp4 = (item: BaseItemDto) => { if (!item.Id) throw new Error("Item is undefined"); updateProcess(item.Id, { progress: percentage, + speed: Math.max(speed, 0), }); }); diff --git a/providers/DownloadProvider.tsx b/providers/DownloadProvider.tsx index 582061d2..f556e140 100644 --- a/providers/DownloadProvider.tsx +++ b/providers/DownloadProvider.tsx @@ -30,6 +30,7 @@ export type ProcessItem = { item: Partial; progress: number; size?: number; + speed?: number; state: | "optimizing" | "downloading"