feat: web add more types (#114)

This commit is contained in:
Ludvig Lundgren 2022-02-05 15:20:54 +01:00 committed by GitHub
parent 6df77de953
commit 8c9f9495ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 191 additions and 137 deletions

View file

@ -1,66 +0,0 @@
interface Action {
id: number;
name: string;
enabled: boolean;
type: ActionType;
exec_cmd: string;
exec_args: string;
watch_folder: string;
category: string;
tags: string;
label: string;
save_path: string;
paused: boolean;
ignore_rules: boolean;
limit_upload_speed: number;
limit_download_speed: number;
client_id: number;
filter_id: number;
}
interface Filter {
id: number;
name: string;
enabled: boolean;
shows: string;
min_size: string;
max_size: string;
match_sites: string[];
except_sites: string[];
delay: number;
years: string;
resolutions: string[];
sources: string[];
codecs: string[];
containers: string[];
match_release_types: string[];
quality: string[];
formats: string[];
media: string[];
match_hdr: string[];
except_hdr: string[];
log_score: number;
log: boolean;
cue: boolean;
perfect_flac: boolean;
artists: string;
albums: string;
seasons: string;
episodes: string;
match_releases: string;
except_releases: string;
match_release_groups: string;
except_release_groups: string;
match_categories: string;
except_categories: string;
tags: string;
except_tags: string;
match_uploaders: string;
except_uploaders: string;
freeleech: boolean;
freeleech_percent: string;
actions: Action[];
indexers: Indexer[];
}
type ActionType = 'TEST' | 'EXEC' | 'WATCH_FOLDER' | DownloadClientType;

View file

@ -6,15 +6,35 @@ type DownloadClientType =
'SONARR' |
'LIDARR';
interface DownloadClientRules {
enabled: boolean;
max_active_downloads: number;
ignore_slow_torrents: boolean;
download_speed_threshold: number;
}
interface DownloadClientBasicAuth {
auth: boolean;
username: string;
password: string;
}
interface DownloadClientSettings {
apikey?: string;
basic?: DownloadClientBasicAuth;
rules?: DownloadClientRules;
}
interface DownloadClient {
id?: number;
name: string;
enabled: boolean;
host: string;
port: number;
ssl: boolean;
username: string;
password: string;
type: DownloadClientType;
settings: object;
id?: number;
id: number;
name: string;
type: DownloadClientType;
enabled: boolean;
host: string;
port: number;
ssl: boolean;
username: string;
password: string;
settings?: DownloadClientSettings;
}

72
web/src/types/Filter.d.ts vendored Normal file
View file

@ -0,0 +1,72 @@
interface Filter {
id: number;
name: string;
enabled: boolean;
created_at: Date;
updated_at: Date;
min_size: string;
max_size: string;
delay: number;
match_releases: string;
except_releases: string;
use_regex: boolean;
match_release_groups: string;
except_release_groups: string;
scene: boolean;
origins: string;
freeleech: boolean;
freeleech_percent: string;
shows: string;
seasons: string;
episodes: string;
resolutions: string[];
codecs: string[];
sources: string[];
containers: string[];
match_hdr: string[];
except_hdr: string[];
years: string;
artists: string;
albums: string;
match_release_types: string[];
except_release_types: string[];
formats: string[];
quality: string[];
media: string[];
perfect_flac: boolean;
cue: boolean;
log: boolean;
log_score: string;
match_categories: string;
except_categories: string;
match_uploaders: string;
except_uploaders: string;
tags: string;
except_tags: string;
tags_any: string;
except_tags_any: string;
actions: Action[];
indexers: Indexer[];
}
interface Action {
id: number;
name: string;
type: ActionType;
enabled: boolean;
exec_cmd?: string;
exec_args?: string;
watch_folder?: string;
category?: string;
tags?: string;
label?: string;
save_path?: string;
paused?: boolean;
ignore_rules?: boolean;
limit_upload_speed?: number;
limit_download_speed?: number;
filter_id?: number;
client_id?: number;
}
type ActionType = 'TEST' | 'EXEC' | 'WATCH_FOLDER' | DownloadClientType;

View file

@ -1,42 +1,64 @@
interface Indexer {
id: number;
name: string;
identifier: string;
enabled: boolean;
settings: object | any;
id: number;
name: string;
identifier: string;
enabled: boolean;
type?: string;
settings: Array<IndexerSetting>;
}
interface IndexerSchema {
name: string;
identifier: string;
description: string;
language: string;
privacy: string;
protocol: string;
urls: string[];
settings: IndexerSchemaSettings[];
irc: IndexerSchemaIRC;
interface IndexerDefinition {
id?: number;
name: string;
identifier: string;
enabled?: boolean;
description: string;
language: string;
privacy: string;
protocol: string;
urls: string[];
supports: string[];
settings: IndexerSetting[];
irc: IndexerIRC;
parse: IndexerParse;
}
interface IndexerSchemaSettings {
name: string;
type: string;
required: boolean;
label: string;
help: string;
description: string;
default: string;
interface IndexerSetting {
name: string;
required?: boolean;
type: string;
value?: string;
label: string;
default?: string;
description?: string;
help?: string;
regex?: string;
}
interface IndexerSchemaIRC {
network: string;
server: string;
port: number;
tls: boolean;
nickserv: boolean;
announcers: string[];
channels: string[];
invite: string[];
invite_command: string;
settings: IndexerSchemaSettings[];
}
interface IndexerIRC {
network: string;
server: string;
port: number;
tls: boolean;
nickserv: boolean;
channels: string[];
announcers: string[];
settings: IndexerSetting[];
}
interface IndexerParse {
type: string;
lines: IndexerParseLines[];
match: IndexerParseMatch;
}
interface IndexerParseLines {
test: string[];
pattern: string;
vars: string[];
}
interface IndexerParseMatch {
torrentUrl: string;
encode: string[];
}