diff --git a/front/packages/models/src/resources/episode.base.ts b/front/packages/models/src/resources/episode.base.ts index ab6907d3..cd236f93 100644 --- a/front/packages/models/src/resources/episode.base.ts +++ b/front/packages/models/src/resources/episode.base.ts @@ -65,7 +65,7 @@ export const BaseEpisodeP = withImages( /** * The link to an HLS master playlist containing all qualities available for this video. */ - hls: z.string().transform(imageFn), + hls: z.string().transform(imageFn).nullable(), }), /** * The id of the show containing this episode diff --git a/front/packages/models/src/resources/movie.ts b/front/packages/models/src/resources/movie.ts index d2343876..481cb5dd 100644 --- a/front/packages/models/src/resources/movie.ts +++ b/front/packages/models/src/resources/movie.ts @@ -94,7 +94,7 @@ export const MovieP = withImages( /** * The link to an HLS master playlist containing all qualities available for this video. */ - hls: z.string().transform(imageFn), + hls: z.string().transform(imageFn).nullable(), }), /** * The link to metadata providers that this show has. diff --git a/front/packages/ui/src/details/header.tsx b/front/packages/ui/src/details/header.tsx index 8897a80c..bd68098a 100644 --- a/front/packages/ui/src/details/header.tsx +++ b/front/packages/ui/src/details/header.tsx @@ -48,11 +48,10 @@ import { Chip, DottedSeparator, focusReset, - SwitchVariant, } from "@kyoo/primitives"; import { Fragment } from "react"; import { useTranslation } from "react-i18next"; -import { ImageStyle, Platform, Text, View } from "react-native"; +import { ImageStyle, Platform, View } from "react-native"; import { Theme, md, @@ -70,9 +69,9 @@ import { Fetch } from "../fetch"; import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; import Theaters from "@material-symbols/svg-400/rounded/theaters-fill.svg"; import { Rating } from "../components/rating"; -import { EpisodeLine, displayRuntime, episodeDisplayNumber } from "./episode"; +import { displayRuntime } from "./episode"; import { WatchListInfo } from "../components/watchlist-info"; -import { ShowWatchStatus, WatchStatusV } from "@kyoo/models/src/resources/watch-status"; +import { WatchStatusV } from "@kyoo/models/src/resources/watch-status"; import { capitalize } from "@kyoo/primitives"; import { ShowWatchStatusCard } from "./show"; diff --git a/front/packages/ui/src/fetch.tsx b/front/packages/ui/src/fetch.tsx index 746aff94..7878baae 100644 --- a/front/packages/ui/src/fetch.tsx +++ b/front/packages/ui/src/fetch.tsx @@ -36,11 +36,6 @@ export type WithLoading = | (Item & { isLoading: false }) | (Partial & { isLoading: true }); -// We keep a Partial on the error value to allow destructuring. -export type WithError = - | (Item & { isError: false; error: undefined }) - | (Partial & { isError: true; error: KyooErrors }); - const isPage = (obj: unknown): obj is Page => (typeof obj === "object" && obj && "items" in obj) || false; @@ -53,8 +48,8 @@ export const Fetch = ({ placeholderCount?: number; children: ( item: Data extends Page - ? WithError> - : WithError>, + ? WithLoading + : WithLoading, i: number, ) => JSX.Element | null; }): JSX.Element | null => { diff --git a/front/packages/ui/src/player/video.tsx b/front/packages/ui/src/player/video.tsx index 2c449d30..afd827f3 100644 --- a/front/packages/ui/src/player/video.tsx +++ b/front/packages/ui/src/player/video.tsx @@ -28,7 +28,7 @@ declare module "react-native-video" { onMediaUnsupported?: () => void; } export type VideoProps = Omit & { - source: { uri: string; hls: string }; + source: { uri: string; hls: string | null }; }; }