mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-22 23:10:35 -04:00
Use posters instead of thumbnails when no thumbnails exist
This commit is contained in:
parent
70466aba7e
commit
b89617d125
@ -25,7 +25,8 @@ import { Genre } from "./genre";
|
|||||||
import { StudioP } from "./studio";
|
import { StudioP } from "./studio";
|
||||||
import { Status } from "./show";
|
import { Status } from "./show";
|
||||||
|
|
||||||
export const MovieP = ResourceP.merge(ImagesP).extend({
|
export const MovieP = ResourceP.merge(ImagesP)
|
||||||
|
.extend({
|
||||||
/**
|
/**
|
||||||
* The title of this movie.
|
* The title of this movie.
|
||||||
*/
|
*/
|
||||||
@ -47,8 +48,7 @@ export const MovieP = ResourceP.merge(ImagesP).extend({
|
|||||||
*/
|
*/
|
||||||
tags: z.array(z.string()),
|
tags: z.array(z.string()),
|
||||||
/**
|
/**
|
||||||
/**
|
* /** Is this movie not aired yet or finished?
|
||||||
* Is this movie not aired yet or finished?
|
|
||||||
*/
|
*/
|
||||||
status: z.nativeEnum(Status),
|
status: z.nativeEnum(Status),
|
||||||
/**
|
/**
|
||||||
@ -82,7 +82,17 @@ export const MovieP = ResourceP.merge(ImagesP).extend({
|
|||||||
*/
|
*/
|
||||||
hls: z.string().transform(imageFn),
|
hls: z.string().transform(imageFn),
|
||||||
}),
|
}),
|
||||||
});
|
})
|
||||||
|
.transform((x) => {
|
||||||
|
if (!x.thumbnail && x.poster) {
|
||||||
|
x.thumbnail = { ...x.poster };
|
||||||
|
if (x.thumbnail) {
|
||||||
|
x.thumbnail.low = x.thumbnail.high;
|
||||||
|
x.thumbnail.medium = x.thumbnail.high;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Movie type
|
* A Movie type
|
||||||
|
@ -35,7 +35,8 @@ export enum Status {
|
|||||||
Planned = "Planned",
|
Planned = "Planned",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ShowP = ResourceP.merge(ImagesP).extend({
|
export const ShowP = ResourceP.merge(ImagesP)
|
||||||
|
.extend({
|
||||||
/**
|
/**
|
||||||
* The title of this show.
|
* The title of this show.
|
||||||
*/
|
*/
|
||||||
@ -84,7 +85,17 @@ export const ShowP = ResourceP.merge(ImagesP).extend({
|
|||||||
* The list of seasons of this show.
|
* The list of seasons of this show.
|
||||||
*/
|
*/
|
||||||
seasons: z.array(SeasonP).optional(),
|
seasons: z.array(SeasonP).optional(),
|
||||||
});
|
})
|
||||||
|
.transform((x) => {
|
||||||
|
if (!x.thumbnail && x.poster) {
|
||||||
|
x.thumbnail = { ...x.poster };
|
||||||
|
if (x.thumbnail) {
|
||||||
|
x.thumbnail.low = x.thumbnail.high;
|
||||||
|
x.thumbnail.medium = x.thumbnail.high;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A tv serie or an anime.
|
* A tv serie or an anime.
|
||||||
|
@ -46,7 +46,7 @@ export const ItemList = ({
|
|||||||
<ImageBackground
|
<ImageBackground
|
||||||
src={thumbnail}
|
src={thumbnail}
|
||||||
alt={name}
|
alt={name}
|
||||||
quality="low"
|
quality="medium"
|
||||||
as={Link}
|
as={Link}
|
||||||
href={href ?? ""}
|
href={href ?? ""}
|
||||||
onFocus={() => setHovered((i) => i + 1)}
|
onFocus={() => setHovered((i) => i + 1)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user