Reverted paths for media on tsx files

This commit is contained in:
Rui Alves 2024-09-22 16:18:33 +01:00
parent 3a54b9251a
commit 02c11806df
4 changed files with 5 additions and 7 deletions

View File

@ -587,7 +587,7 @@ class PreviewFramesController extends PreviewController {
if (this.seeking) { if (this.seeking) {
this.timeToSeek = frame; this.timeToSeek = frame;
} else { } else {
const newSrc = `${baseUrl}api/media/preview/preview_${this.camera}-${frame}.webp/thumbnail.webp`; const newSrc = `${baseUrl}api/preview/preview_${this.camera}-${frame}.webp/thumbnail.webp`;
if (this.imgController.current.src != newSrc) { if (this.imgController.current.src != newSrc) {
this.imgController.current.src = newSrc; this.imgController.current.src = newSrc;
@ -604,7 +604,7 @@ class PreviewFramesController extends PreviewController {
} }
if (this.timeToSeek) { if (this.timeToSeek) {
const newSrc = `${baseUrl}api/media/preview/preview_${this.camera}-${this.timeToSeek}.webp/thumbnail.webp`; const newSrc = `${baseUrl}api/preview/preview_${this.camera}-${this.timeToSeek}.webp/thumbnail.webp`;
if (this.imgController.current.src != newSrc) { if (this.imgController.current.src != newSrc) {
this.imgController.current.src = newSrc; this.imgController.current.src = newSrc;

View File

@ -42,7 +42,7 @@ export function PolygonCanvas({
const element = new window.Image(); const element = new window.Image();
element.width = width; element.width = width;
element.height = height; element.height = height;
element.src = `${apiHost}api/${camera}/latest?extension=webp&?cache=${Date.now()}`; element.src = `${apiHost}api/${camera}/latest.webp?cache=${Date.now()}`;
return element; return element;
} }
// we know that these deps are correct // we know that these deps are correct

View File

@ -499,9 +499,7 @@ function PtzControlPanel({
clickOverlay: boolean; clickOverlay: boolean;
setClickOverlay: React.Dispatch<React.SetStateAction<boolean>>; setClickOverlay: React.Dispatch<React.SetStateAction<boolean>>;
}) { }) {
const { data: ptz } = useSWR<CameraPtzInfo>( const { data: ptz } = useSWR<CameraPtzInfo>(`${camera}/ptz/info`);
`${camera}/ptz/info`,
);
const { send: sendPtz } = usePtzCommand(camera); const { send: sendPtz } = usePtzCommand(camera);

View File

@ -18,7 +18,7 @@ type StorageMetricsProps = {
export default function StorageMetrics({ export default function StorageMetrics({
setLastUpdated, setLastUpdated,
}: StorageMetricsProps) { }: StorageMetricsProps) {
const { data: cameraStorage } = useSWR<CameraStorage>("media/recordings/storage"); const { data: cameraStorage } = useSWR<CameraStorage>("recordings/storage");
const { data: stats } = useSWR<FrigateStats>("stats"); const { data: stats } = useSWR<FrigateStats>("stats");
const totalStorage = useMemo(() => { const totalStorage = useMemo(() => {