From 2cea7ed29272f8ea2edcd752c88d186c4b34c8e1 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Fri, 5 Jan 2024 09:52:26 -0700 Subject: [PATCH] Prevent new torrents from being removed from the debrid provider when the symlink download client is selected. Make the downloader an option when adding a new torrent. --- .../add-new-torrent.component.html | 19 ++++++++++++++++--- .../add-new-torrent.component.ts | 14 ++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/client/src/app/add-new-torrent/add-new-torrent.component.html b/client/src/app/add-new-torrent/add-new-torrent.component.html index f7fbc4b..99bb7b4 100644 --- a/client/src/app/add-new-torrent/add-new-torrent.component.html +++ b/client/src/app/add-new-torrent/add-new-torrent.component.html @@ -42,6 +42,20 @@
Advanced settings
+
+ +
+ +
+

+ Select which downloader is used to download this torrent from the debrid provider to your host. +

+
+
@@ -103,14 +117,13 @@

This setting does not apply to manually selected files.

-
diff --git a/client/src/app/add-new-torrent/add-new-torrent.component.ts b/client/src/app/add-new-torrent/add-new-torrent.component.ts index 94d50d9..2087720 100644 --- a/client/src/app/add-new-torrent/add-new-torrent.component.ts +++ b/client/src/app/add-new-torrent/add-new-torrent.component.ts @@ -15,6 +15,7 @@ export class AddNewTorrentComponent implements OnInit { private currentTorrentFile: string; public provider: string; + public downloadClient: number; public category: string; public hostDownloadAction: number = 0; @@ -46,6 +47,7 @@ export class AddNewTorrentComponent implements OnInit { this.settingsService.get().subscribe((settings) => { const providerSetting = settings.first((m) => m.key === 'Provider:Provider'); this.provider = providerSetting.enumValues[providerSetting.value as number]; + this.downloadClient = settings.first((m) => m.key === 'DownloadClient:Client')?.value as number; this.category = settings.first((m) => m.key === 'Gui:Default:Category')?.value as string; this.hostDownloadAction = this.downloadAction = settings.first((m) => m.key === 'Gui:Default:HostDownloadAction') @@ -60,9 +62,21 @@ export class AddNewTorrentComponent implements OnInit { this.torrentDeleteOnError = settings.first((m) => m.key === 'Gui:Default:DeleteOnError')?.value as number; this.torrentLifetime = settings.first((m) => m.key === 'Gui:Default:TorrentLifetime')?.value as number; this.priority = settings.first((m) => m.key === 'Gui:Default:Priority')?.value as number; + + this.setFinishAction(); }); } + public setFinishAction() { + if (this.downloadClient === 2){ + if (this.finishedAction === 1){ + this.finishedAction = 3; + } else if (this.finishedAction === 2){ + this.finishedAction = 0; + } + } + } + public pickFile(evt: Event): void { const files = (evt.target as HTMLInputElement).files;