feat(actions): qBittorrent add priority handling (#1315)

* feat(qbittorrent): add priority handling

* fix: check if torrent queueing is enabled

* fix: only check for torrent queueing if priority is set

* fix: improve tooltip message

* feat: enable torrent queueing if disabled

* change to SetPreferencesQueueingEnabled

* feat(actions): rename field

* chore: bump pkg go-qbittorrent to v1.8.0

* chore(deps): update go-qbittorrent to v1.8.1

* chore(deps): go mod tidy

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
soup 2023-12-25 22:39:31 +01:00 committed by GitHub
parent 0ab404f81a
commit c6122dbc41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 115 additions and 30 deletions

View file

@ -349,6 +349,12 @@ export const ActionContentLayoutOptions: SelectGenericOption<ActionContentLayout
{ label: "Don't create subfolder", description: "Don't create subfolder", value: "SUBFOLDER_NONE" }
];
export const ActionPriorityOptions: SelectGenericOption<ActionPriorityLayout>[] = [
{ label: "Top of queue", description: "Top of queue", value: "MAX" },
{ label: "Bottom of queue", description: "Bottom of queue", value: "MIN" },
{ label: "Disabled", description: "Disabled", value: "" }
];
export const ActionRtorrentRenameOptions: SelectGenericOption<ActionContentLayout>[] = [
{ label: "No", description: "No", value: "ORIGINAL" },
{ label: "Yes", description: "Yes", value: "SUBFOLDER_NONE" }

View file

@ -54,6 +54,7 @@ export function Actions({ filter, values }: FilterActionsProps) {
ignore_rules: false,
skip_hash_check: false,
content_layout: "" || undefined,
priority: "" || undefined,
limit_upload_speed: 0,
limit_download_speed: 0,
limit_ratio: 0,

View file

@ -1,7 +1,7 @@
import { Link } from "react-router-dom";
import { DocsLink } from "@components/ExternalLink";
import { ActionContentLayoutOptions } from "@domain/constants";
import { ActionContentLayoutOptions, ActionPriorityOptions } from "@domain/constants";
import * as Input from "@components/inputs";
import { CollapsibleSection } from "../_components";
@ -105,6 +105,19 @@ export const QBittorrent = ({ idx, action, clients }: ClientActionProps) => (
description="Add torrent and skip hash check"
/>
</FilterSection.HalfRow>
<FilterSection.HalfRow>
<Input.Select
name={`actions.${idx}.priority`}
label="Priority"
optionDefaultText="Disabled"
options={ActionPriorityOptions}
tooltip={
<div>
<p>Torrent Queueing will be enabled for you if it is disabled. Ensure you set your preferred limits for it in your client.</p>
</div>
}
/>
</FilterSection.HalfRow>
</CollapsibleSection>
<CollapsibleSection

View file

@ -90,6 +90,7 @@ interface Action {
ignore_rules?: boolean;
skip_hash_check: boolean;
content_layout?: ActionContentLayout;
priority?: ActionPriorityLayout;
limit_upload_speed?: number;
limit_download_speed?: number;
limit_ratio?: number;
@ -110,6 +111,8 @@ interface Action {
type ActionContentLayout = "ORIGINAL" | "SUBFOLDER_CREATE" | "SUBFOLDER_NONE";
type ActionPriorityLayout = "MAX" | "MIN" | "";
type ActionType = "TEST" | "EXEC" | "WATCH_FOLDER" | "WEBHOOK" | DownloadClientType;
type ExternalType = "EXEC" | "WEBHOOK";