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 56b1c68..8156fc9 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
@@ -220,9 +220,26 @@
-
-
-
+ @if (categories.length > 0) {
+
+
+
+ @if (categorySelect === '__custom__') {
+
+
+
+ }
+ } @else {
+
+
+
+ }
The category becomes a sub-folder in your main download path.
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 a96198c..47dd1e0 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
@@ -25,6 +25,8 @@ export class AddNewTorrentComponent implements OnInit {
public downloadClient: number;
public category: string;
+ public categories: string[] = [];
+ public categorySelect: string = '';
public hostDownloadAction: number = 0;
public downloadAction: number = 0;
public finishedAction: number = 0;
@@ -81,6 +83,13 @@ export class AddNewTorrentComponent implements OnInit {
this.downloadClient = settings.find((m) => m.key === 'DownloadClient:Client')?.value as number;
this.category = settings.find((m) => m.key === 'Gui:Default:Category')?.value as string;
+ const categoriesSetting = settings.find((m) => m.key === 'General:Categories')?.value as string;
+ this.categories = (categoriesSetting ?? '').split(',').map((c) => c.trim()).filter((c) => c.length > 0);
+ if (this.categories.includes(this.category)) {
+ this.categorySelect = this.category;
+ } else if (this.category) {
+ this.categorySelect = '__custom__';
+ }
this.hostDownloadAction = this.downloadAction = settings.find((m) => m.key === 'Gui:Default:HostDownloadAction')
?.value as number;
this.downloadAction =
@@ -100,6 +109,14 @@ export class AddNewTorrentComponent implements OnInit {
});
}
+ public onCategorySelectChange(value: string): void {
+ if (value !== '__custom__') {
+ this.category = value;
+ } else {
+ this.category = '';
+ }
+ }
+
public setFinishAction() {
if (this.downloadClient === 2) {
if (this.finishedAction === 1) {