mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-01 05:21:51 +01:00
37 lines
854 B
TypeScript
37 lines
854 B
TypeScript
import { DetailedMeta } from "../metadata/getmeta";
|
|
import { MWMediaType } from "../metadata/types";
|
|
import { MWEmbed } from "./embed";
|
|
import { MWStream } from "./streams";
|
|
|
|
export type MWProviderScrapeResult = {
|
|
stream?: MWStream;
|
|
embeds: MWEmbed[];
|
|
};
|
|
|
|
type MWProviderBase = {
|
|
progress(percentage: number): void;
|
|
media: DetailedMeta;
|
|
};
|
|
type MWProviderTypeSpecific =
|
|
| {
|
|
type: MWMediaType.MOVIE | MWMediaType.ANIME;
|
|
episode?: undefined;
|
|
season?: undefined;
|
|
}
|
|
| {
|
|
type: MWMediaType.SERIES;
|
|
episode: string;
|
|
season: string;
|
|
};
|
|
export type MWProviderContext = MWProviderTypeSpecific & MWProviderBase;
|
|
|
|
export type MWProvider = {
|
|
id: string;
|
|
displayName: string;
|
|
rank: number;
|
|
disabled?: boolean;
|
|
type: MWMediaType[];
|
|
|
|
scrape(ctx: MWProviderContext): Promise<MWProviderScrapeResult>;
|
|
};
|