mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-18 03:53:14 +02:00
feat: Backend implementation for source plugin usage and configuration
This commit is contained in:
45
backend/plugins/plugin-types.d.ts
vendored
Normal file
45
backend/plugins/plugin-types.d.ts
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
export type PluginSettingsTemplate = Record<
|
||||
string,
|
||||
'string' | 'number' | 'boolean' | 'password' | { type: 'link'; url: string }
|
||||
>;
|
||||
|
||||
export type PluginSettings = Record<string, any>;
|
||||
|
||||
export interface SourcePlugin {
|
||||
name: string;
|
||||
|
||||
getIsIndexable: () => boolean;
|
||||
|
||||
getIndex: () => Promise<
|
||||
Record<
|
||||
number,
|
||||
any
|
||||
// | { tmdbId: number; quality: number }
|
||||
// | {
|
||||
// tmdbId: number;
|
||||
// seasons: Record<number, Record<number, { quality: number }>>;
|
||||
// }
|
||||
>
|
||||
>;
|
||||
|
||||
getSettingsTemplate: () => PluginSettingsTemplate;
|
||||
|
||||
validateSettings: (settings: Record<string, any>) => Promise<{
|
||||
isValid: boolean;
|
||||
errors: Record<string, string>;
|
||||
}>;
|
||||
|
||||
getMovieStream: (tmdbId: string, settings: PluginSettings) => Promise<any>;
|
||||
|
||||
getEpisodeStream: (
|
||||
tmdbId: string,
|
||||
season: number,
|
||||
episode: number,
|
||||
settings: PluginSettings,
|
||||
) => Promise<any>;
|
||||
|
||||
handleProxy(request: { uri: string; headers: any }, settings: PluginSettings): {
|
||||
url: string;
|
||||
headers: any;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user