mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(clients): override arr download client by name (#1328)
* feat(clients): override arr client by name * feat(clients): add missing file * feat(clients): add section download client arr
This commit is contained in:
parent
45b522abf8
commit
fbabdfb217
22 changed files with 143 additions and 49 deletions
|
@ -41,6 +41,8 @@ interface InitialValuesSettings {
|
|||
download_speed_threshold?: number;
|
||||
max_active_downloads?: number;
|
||||
};
|
||||
external_download_client_id?: number;
|
||||
external_download_client?: string;
|
||||
}
|
||||
|
||||
interface InitialValues {
|
||||
|
@ -135,8 +137,6 @@ function FormFieldsArr() {
|
|||
<PasswordFieldWide name="settings.basic.password" label="Password" />
|
||||
</>
|
||||
)}
|
||||
|
||||
<NumberFieldWide name="settings.external_download_client_id" label="Download Client ID" tooltip={<div><p>Specify what client the arr should use by default. Can be overridden per filter action. You can find the id in the arr by looking at the network responses for download clients.</p></div>} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -432,6 +432,29 @@ function FormFieldsRulesBasic() {
|
|||
);
|
||||
}
|
||||
|
||||
function FormFieldsRulesArr() {
|
||||
// const {
|
||||
// values: { settings }
|
||||
// } = useFormikContext<InitialValues>();
|
||||
|
||||
return (
|
||||
<div className="border-t border-gray-200 dark:border-gray-700 py-5 px-2">
|
||||
<div className="px-4 space-y-1">
|
||||
<Dialog.Title className="text-lg font-medium text-gray-900 dark:text-white">
|
||||
Download Client
|
||||
</Dialog.Title>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||
Override download client to use. Can also be overridden per Filter Action.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<TextFieldWide name="settings.external_download_client" label="Client Name" tooltip={<div><p>Specify what client the arr should use by default. Can be overridden per filter action.</p></div>} />
|
||||
|
||||
<NumberFieldWide name="settings.external_download_client_id" label="Client ID DEPRECATED" tooltip={<div><p>DEPRECATED: Use Client name field instead.</p></div>} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function FormFieldsRulesQbit() {
|
||||
const {
|
||||
values: { settings }
|
||||
|
@ -544,7 +567,12 @@ export const rulesComponentMap: componentMapType = {
|
|||
DELUGE_V2: <FormFieldsRulesBasic />,
|
||||
QBITTORRENT: <FormFieldsRulesQbit />,
|
||||
PORLA: <FormFieldsRulesBasic />,
|
||||
TRANSMISSION: <FormFieldsRulesTransmission />
|
||||
TRANSMISSION: <FormFieldsRulesTransmission />,
|
||||
RADARR: <FormFieldsRulesArr />,
|
||||
SONARR: <FormFieldsRulesArr />,
|
||||
LIDARR: <FormFieldsRulesArr />,
|
||||
WHISPARR: <FormFieldsRulesArr />,
|
||||
READARR: <FormFieldsRulesArr />,
|
||||
};
|
||||
|
||||
interface formButtonsProps {
|
||||
|
|
|
@ -70,6 +70,7 @@ export function Actions({ filter, values }: FilterActionsProps) {
|
|||
webhook_data: "",
|
||||
webhook_headers: [],
|
||||
external_download_client_id: 0,
|
||||
external_download_client: "",
|
||||
client_id: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -118,16 +118,29 @@ export const Arr = ({ idx, action, clients }: ClientActionProps) => (
|
|||
</FilterSection.HalfRow>
|
||||
|
||||
<FilterSection.HalfRow>
|
||||
<Input.NumberField
|
||||
name={`actions.${idx}.external_download_client_id`}
|
||||
label="Override download client id for arr"
|
||||
tooltip={
|
||||
<p>
|
||||
Override Download client Id from the one set in Clients. Useful if you
|
||||
have multiple clients inside the arr.
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
<div className="">
|
||||
<Input.TextField
|
||||
name={`actions.${idx}.external_download_client`}
|
||||
label="Override download client name for arr"
|
||||
tooltip={
|
||||
<p>
|
||||
Override Download client name from the one set in Clients. Useful if you
|
||||
have multiple clients inside the arr.
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
<Input.NumberField
|
||||
name={`actions.${idx}.external_download_client_id`}
|
||||
label="Override download client id for arr DEPRECATED"
|
||||
className="mt-4"
|
||||
tooltip={
|
||||
<p>
|
||||
Override Download client Id from the one set in Clients. Useful if you
|
||||
have multiple clients inside the arr.
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</FilterSection.HalfRow>
|
||||
</FilterSection.Layout>
|
||||
</FilterSection.Section>
|
||||
|
|
1
web/src/types/Download.d.ts
vendored
1
web/src/types/Download.d.ts
vendored
|
@ -49,6 +49,7 @@ interface DownloadClientSettings {
|
|||
basic?: DownloadClientBasicAuth;
|
||||
rules?: DownloadClientRules;
|
||||
external_download_client_id?: number;
|
||||
external_download_client?: string;
|
||||
}
|
||||
|
||||
interface DownloadClient {
|
||||
|
|
1
web/src/types/Filter.d.ts
vendored
1
web/src/types/Filter.d.ts
vendored
|
@ -105,6 +105,7 @@ interface Action {
|
|||
webhook_data: string,
|
||||
webhook_headers: string[];
|
||||
external_download_client_id?: number;
|
||||
external_download_client?: string;
|
||||
client_id?: number;
|
||||
filter_id?: number;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue