chore: url parsing stuff for later when I have time

This commit is contained in:
Adrian Castro
2024-04-01 18:20:56 +02:00
parent 2399926cbc
commit 30e52c2b72
4 changed files with 21 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ import { usePlayerStore } from "~/stores/player/store";
import { ScrapeCard, ScrapeItem } from "./ScrapeCard";
interface ScraperProcessProps {
data?: ItemData;
data?: Partial<ItemData>;
media?: ScrapeMedia;
download?: boolean;
}
@@ -53,12 +53,12 @@ export const ScraperProcess = ({
useEffect(() => {
const fetchData = async () => {
if (!data && !media) return router.back();
if (!data?.id && !media) return router.back();
let streamResult: RunOutput | null = null;
let meta: PlayerMeta | undefined = undefined;
if (!media && data) {
if (!media && data?.id && data.type) {
meta = await convertIdToMeta(data.id, data.type);
if (!meta) return router.back();
}