Feature: Lidarr (#15)

* feat(web): add lidarr download client

* feat: add lidarr download client
This commit is contained in:
Ludvig Lundgren 2021-08-22 02:17:13 +02:00 committed by GitHub
parent fce6c7149a
commit e6cfc77e85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 582 additions and 15 deletions

View file

@ -317,6 +317,7 @@ function ListItem({ action, clients, filterID, idx }: ListItemProps) {
);
case "RADARR":
case "SONARR":
case "LIDARR":
return (
<div className="mt-6 grid grid-cols-12 gap-6">
<DownloadClientSelect

View file

@ -74,13 +74,15 @@ export const DownloadClientTypeOptions: radioFieldsetOption[] = [
{label: "Deluge 2", description: "Add torrents directly to Deluge 2", value: DOWNLOAD_CLIENT_TYPES.DelugeV2},
{label: "Radarr", description: "Send to Radarr and let it decide", value: DOWNLOAD_CLIENT_TYPES.Radarr},
{label: "Sonarr", description: "Send to Sonarr and let it decide", value: DOWNLOAD_CLIENT_TYPES.Sonarr},
{label: "Lidarr", description: "Send to Lidarr and let it decide", value: DOWNLOAD_CLIENT_TYPES.Lidarr},
];
export const DownloadClientTypeNameMap = {
"DELUGE_V1": "Deluge v1",
"DELUGE_V2": "Deluge v2",
"QBITTORRENT": "qBittorrent",
"RADARR": "Radarr",
"SONARR": "Sonarr"
"SONARR": "Sonarr",
"LIDARR": "Lidarr",
};
export const ActionTypeOptions: radioFieldsetOption[] = [
@ -92,6 +94,7 @@ export const ActionTypeOptions: radioFieldsetOption[] = [
{label: "Deluge v2", description: "Add torrents directly to Deluge 2", value: "DELUGE_V2"},
{label: "Radarr", description: "Send to Radarr and let it decide", value: DOWNLOAD_CLIENT_TYPES.Radarr},
{label: "Sonarr", description: "Send to Sonarr and let it decide", value: DOWNLOAD_CLIENT_TYPES.Sonarr},
{label: "Lidarr", description: "Send to Lidarr and let it decide", value: DOWNLOAD_CLIENT_TYPES.Lidarr},
];
export const ActionTypeNameMap = {
@ -102,5 +105,6 @@ export const ActionTypeNameMap = {
"DELUGE_V2": "Deluge v2",
"QBITTORRENT": "qBittorrent",
"RADARR": "Radarr",
"SONARR": "Sonarr"
"SONARR": "Sonarr",
"LIDARR": "Lidarr",
};

View file

@ -64,18 +64,19 @@ export interface Filter {
indexers: Indexer[];
}
export type ActionType = 'TEST' | 'EXEC' | 'WATCH_FOLDER' | 'QBITTORRENT' | 'DELUGE_V1' | 'DELUGE_V2' | 'RADARR' | 'SONARR';
export const ACTIONTYPES: ActionType[] = ['TEST', 'EXEC' , 'WATCH_FOLDER' , 'QBITTORRENT' , 'DELUGE_V1', 'DELUGE_V2', 'RADARR', 'SONARR'];
export type ActionType = 'TEST' | 'EXEC' | 'WATCH_FOLDER' | 'QBITTORRENT' | 'DELUGE_V1' | 'DELUGE_V2' | 'RADARR' | 'SONARR' | 'LIDARR';
export const ACTIONTYPES: ActionType[] = ['TEST', 'EXEC' , 'WATCH_FOLDER' , 'QBITTORRENT' , 'DELUGE_V1', 'DELUGE_V2', 'RADARR', 'SONARR', 'LIDARR'];
export type DownloadClientType = 'QBITTORRENT' | 'DELUGE_V1' | 'DELUGE_V2' | 'RADARR' | 'SONARR';
export type DownloadClientType = 'QBITTORRENT' | 'DELUGE_V1' | 'DELUGE_V2' | 'RADARR' | 'SONARR' | 'LIDARR';
export enum DOWNLOAD_CLIENT_TYPES {
qBittorrent = 'QBITTORRENT',
DelugeV1 = 'DELUGE_V1',
DelugeV2 = 'DELUGE_V2',
Radarr = 'RADARR',
Sonarr = 'SONARR'
Sonarr = 'SONARR',
Lidarr = 'LIDARR'
}
export interface DownloadClient {

View file

@ -258,6 +258,7 @@ function FilterActionAddForm({ filter, isOpen, toggle, clients }: props) {
);
case "RADARR":
case "SONARR":
case "LIDARR":
return (
<div>
<DownloadClientSelect

View file

@ -164,6 +164,8 @@ function FilterActionUpdateForm({
</div>
);
case "RADARR":
case "SONARR":
case "LIDARR":
return (
<div>
<DownloadClientSelect

View file

@ -1,9 +1,9 @@
import React, { Fragment } from "react";
import { Fragment } from "react";
import { SwitchGroup, TextFieldWide } from "../../../components/inputs";
import { NumberFieldWide } from "../../../components/inputs/wide";
import { useField } from "react-final-form";
function FormDefaultClientFields() {
function FormFieldsDefault() {
return (
<Fragment>
<TextFieldWide name="host" label="Host" />
@ -20,7 +20,7 @@ function FormDefaultClientFields() {
);
}
function FormRadarrFields() {
function FormFieldsArr() {
const { input } = useField("settings.basic.auth");
return (
<Fragment>
@ -42,11 +42,11 @@ function FormRadarrFields() {
);
}
// @ts-ignore
export const componentMap: any = {
DELUGE_V1: <FormDefaultClientFields />,
DELUGE_V2: <FormDefaultClientFields />,
QBITTORRENT: <FormDefaultClientFields />,
RADARR: <FormRadarrFields />,
SONARR: <FormRadarrFields />,
DELUGE_V1: <FormFieldsDefault />,
DELUGE_V2: <FormFieldsDefault />,
QBITTORRENT: <FormFieldsDefault />,
RADARR: <FormFieldsArr />,
SONARR: <FormFieldsArr />,
LIDARR: <FormFieldsArr />,
};