mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Use posters instead of thumbnails when no thumbnails exist
This commit is contained in:
parent
70466aba7e
commit
b89617d125
@ -25,64 +25,74 @@ import { Genre } from "./genre";
|
||||
import { StudioP } from "./studio";
|
||||
import { Status } from "./show";
|
||||
|
||||
export const MovieP = ResourceP.merge(ImagesP).extend({
|
||||
/**
|
||||
* The title of this movie.
|
||||
*/
|
||||
name: z.string(),
|
||||
/**
|
||||
* A catchphrase for this show.
|
||||
*/
|
||||
tagline: z.string().nullable(),
|
||||
/**
|
||||
* The list of alternative titles of this movie.
|
||||
*/
|
||||
aliases: z.array(z.string()),
|
||||
/**
|
||||
* The summary of this movie.
|
||||
*/
|
||||
overview: z.string().nullable(),
|
||||
/**
|
||||
* A list of tags that match this movie.
|
||||
*/
|
||||
tags: z.array(z.string()),
|
||||
/**
|
||||
/**
|
||||
* Is this movie not aired yet or finished?
|
||||
*/
|
||||
status: z.nativeEnum(Status),
|
||||
/**
|
||||
* The date this movie aired. It can also be null if this is unknown.
|
||||
*/
|
||||
airDate: zdate().nullable(),
|
||||
/**
|
||||
* A youtube url for the trailer.
|
||||
*/
|
||||
trailer: z.string().optional().nullable(),
|
||||
/**
|
||||
* The list of genres (themes) this movie has.
|
||||
*/
|
||||
genres: z.array(z.nativeEnum(Genre)),
|
||||
/**
|
||||
* The studio that made this movie.
|
||||
*/
|
||||
studio: StudioP.optional().nullable(),
|
||||
|
||||
/**
|
||||
* The links to see a movie or an episode.
|
||||
*/
|
||||
links: z.object({
|
||||
export const MovieP = ResourceP.merge(ImagesP)
|
||||
.extend({
|
||||
/**
|
||||
* The direct link to the unprocessed video (pristine quality).
|
||||
* The title of this movie.
|
||||
*/
|
||||
direct: z.string().transform(imageFn),
|
||||
name: z.string(),
|
||||
/**
|
||||
* A catchphrase for this show.
|
||||
*/
|
||||
tagline: z.string().nullable(),
|
||||
/**
|
||||
* The list of alternative titles of this movie.
|
||||
*/
|
||||
aliases: z.array(z.string()),
|
||||
/**
|
||||
* The summary of this movie.
|
||||
*/
|
||||
overview: z.string().nullable(),
|
||||
/**
|
||||
* A list of tags that match this movie.
|
||||
*/
|
||||
tags: z.array(z.string()),
|
||||
/**
|
||||
* /** Is this movie not aired yet or finished?
|
||||
*/
|
||||
status: z.nativeEnum(Status),
|
||||
/**
|
||||
* The date this movie aired. It can also be null if this is unknown.
|
||||
*/
|
||||
airDate: zdate().nullable(),
|
||||
/**
|
||||
* A youtube url for the trailer.
|
||||
*/
|
||||
trailer: z.string().optional().nullable(),
|
||||
/**
|
||||
* The list of genres (themes) this movie has.
|
||||
*/
|
||||
genres: z.array(z.nativeEnum(Genre)),
|
||||
/**
|
||||
* The studio that made this movie.
|
||||
*/
|
||||
studio: StudioP.optional().nullable(),
|
||||
|
||||
/**
|
||||
* The link to an HLS master playlist containing all qualities available for this video.
|
||||
* The links to see a movie or an episode.
|
||||
*/
|
||||
hls: z.string().transform(imageFn),
|
||||
}),
|
||||
});
|
||||
links: z.object({
|
||||
/**
|
||||
* The direct link to the unprocessed video (pristine quality).
|
||||
*/
|
||||
direct: z.string().transform(imageFn),
|
||||
|
||||
/**
|
||||
* The link to an HLS master playlist containing all qualities available for this video.
|
||||
*/
|
||||
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
|
||||
|
@ -35,56 +35,67 @@ export enum Status {
|
||||
Planned = "Planned",
|
||||
}
|
||||
|
||||
export const ShowP = ResourceP.merge(ImagesP).extend({
|
||||
/**
|
||||
* The title of this show.
|
||||
*/
|
||||
name: z.string(),
|
||||
/**
|
||||
* A catchphrase for this show.
|
||||
*/
|
||||
tagline: z.string().nullable(),
|
||||
/**
|
||||
* The list of alternative titles of this show.
|
||||
*/
|
||||
aliases: z.array(z.string()),
|
||||
/**
|
||||
* The summary of this show.
|
||||
*/
|
||||
overview: z.string().nullable(),
|
||||
/**
|
||||
* A list of tags that match this movie.
|
||||
*/
|
||||
tags: z.array(z.string()),
|
||||
/**
|
||||
* Is this show airing, not aired yet or finished?
|
||||
*/
|
||||
status: z.nativeEnum(Status),
|
||||
/**
|
||||
* The date this show started airing. It can be null if this is unknown.
|
||||
*/
|
||||
startAir: zdate().nullable(),
|
||||
/**
|
||||
* The date this show finished airing. It can also be null if this is unknown.
|
||||
*/
|
||||
endAir: zdate().nullable(),
|
||||
/**
|
||||
* The list of genres (themes) this show has.
|
||||
*/
|
||||
genres: z.array(z.nativeEnum(Genre)),
|
||||
/**
|
||||
* A youtube url for the trailer.
|
||||
*/
|
||||
trailer: z.string().optional().nullable(),
|
||||
/**
|
||||
* The studio that made this show.
|
||||
*/
|
||||
studio: StudioP.optional().nullable(),
|
||||
/**
|
||||
* The list of seasons of this show.
|
||||
*/
|
||||
seasons: z.array(SeasonP).optional(),
|
||||
});
|
||||
export const ShowP = ResourceP.merge(ImagesP)
|
||||
.extend({
|
||||
/**
|
||||
* The title of this show.
|
||||
*/
|
||||
name: z.string(),
|
||||
/**
|
||||
* A catchphrase for this show.
|
||||
*/
|
||||
tagline: z.string().nullable(),
|
||||
/**
|
||||
* The list of alternative titles of this show.
|
||||
*/
|
||||
aliases: z.array(z.string()),
|
||||
/**
|
||||
* The summary of this show.
|
||||
*/
|
||||
overview: z.string().nullable(),
|
||||
/**
|
||||
* A list of tags that match this movie.
|
||||
*/
|
||||
tags: z.array(z.string()),
|
||||
/**
|
||||
* Is this show airing, not aired yet or finished?
|
||||
*/
|
||||
status: z.nativeEnum(Status),
|
||||
/**
|
||||
* The date this show started airing. It can be null if this is unknown.
|
||||
*/
|
||||
startAir: zdate().nullable(),
|
||||
/**
|
||||
* The date this show finished airing. It can also be null if this is unknown.
|
||||
*/
|
||||
endAir: zdate().nullable(),
|
||||
/**
|
||||
* The list of genres (themes) this show has.
|
||||
*/
|
||||
genres: z.array(z.nativeEnum(Genre)),
|
||||
/**
|
||||
* A youtube url for the trailer.
|
||||
*/
|
||||
trailer: z.string().optional().nullable(),
|
||||
/**
|
||||
* The studio that made this show.
|
||||
*/
|
||||
studio: StudioP.optional().nullable(),
|
||||
/**
|
||||
* The list of seasons of this show.
|
||||
*/
|
||||
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.
|
||||
|
@ -46,7 +46,7 @@ export const ItemList = ({
|
||||
<ImageBackground
|
||||
src={thumbnail}
|
||||
alt={name}
|
||||
quality="low"
|
||||
quality="medium"
|
||||
as={Link}
|
||||
href={href ?? ""}
|
||||
onFocus={() => setHovered((i) => i + 1)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user