Fix player for unmatched videos

This commit is contained in:
Zoe Roux 2026-03-14 12:50:48 +01:00
parent 9af7e070d1
commit 38d1583950
No known key found for this signature in database
4 changed files with 29 additions and 20 deletions

View File

@ -36,10 +36,12 @@ export const FullVideo = t.Composite([
),
),
show: t.Optional(
t.Union([
t.Composite([t.Object({ kind: t.Literal("movie") }), Movie]),
t.Composite([t.Object({ kind: t.Literal("serie") }), Serie]),
]),
t.Nullable(
t.Union([
t.Composite([t.Object({ kind: t.Literal("movie") }), Movie]),
t.Composite([t.Object({ kind: t.Literal("serie") }), Serie]),
]),
),
),
}),
]);

View File

@ -50,7 +50,7 @@ export const FullVideo = Video.extend({
}),
previous: z.object({ video: z.string(), entry: Entry }).nullable().optional(),
next: z.object({ video: z.string(), entry: Entry }).nullable().optional(),
show: Show.optional(),
show: Show.optional().nullable(),
});
export type FullVideo = z.infer<typeof FullVideo>;

View File

@ -50,18 +50,25 @@ export const BottomControls = ({
return (
<View className={cn("flex-row p-2", className)} {...props}>
<View className="m-4 w-1/5 max-w-50 max-sm:hidden">
{poster !== undefined ? (
<Poster
src={poster}
quality="low"
className="absolute bottom-0 w-full"
/>
) : (
<Poster.Loader className="absolute bottom-0 w-full" />
{poster !== null && (
<View className="m-4 w-1/5 max-w-50 max-sm:hidden">
{poster !== undefined ? (
<Poster
src={poster}
quality="low"
className="absolute bottom-0 w-full"
/>
) : (
<Poster.Loader className="absolute bottom-0 w-full" />
)}
</View>
)}
<View
className={cn(
"my-1 mr-4 flex-1 max-sm:ml-4 sm:my-6",
poster === null && "ml-4",
)}
</View>
<View className="my-1 mr-4 flex-1 max-sm:ml-4 sm:my-6">
>
{!bottomSeek &&
(name ? (
<H2 numberOfLines={1} className="pb-2 text-slate-200">

View File

@ -36,7 +36,7 @@ export const Player = () => {
? entry.kind === "movie"
? entry.name
: `${entry.name} (${entryDisplayNumber(entry)})`
: null;
: data?.path;
const { apiUrl, authToken } = useToken();
const [defaultPlayMode] = useLocalSetting<"direct" | "hls">(
@ -187,14 +187,14 @@ export const Player = () => {
<Controls
player={player}
showHref={data?.show?.href}
name={data?.show?.name}
poster={data?.show?.poster}
name={data?.show?.name ?? data?.path}
poster={data ? (data.show?.poster ?? null) : undefined}
subName={
entry
? [entryDisplayNumber(entry), entry.name]
.filter((x) => x)
.join(" - ")
: undefined
: data?.path
}
chapters={info?.chapters ?? []}
previous={data?.previous?.video}