From a26fd1da5dfa5c6be65f4e8ea6a8009e07308bbc Mon Sep 17 00:00:00 2001 From: Flaminel Date: Tue, 24 Jun 2025 21:21:14 +0300 Subject: [PATCH] removed usenet type --- .../Dtos/CreateDownloadClientDto.cs | 4 +-- .../Enums/DownloadClientTypeName.cs | 1 - .../Features/Jobs/GenericHandler.cs | 5 ---- .../Health/HealthCheckService.cs | 1 - .../Configuration/DownloadClientConfig.cs | 6 ++--- .../download-client-settings.component.html | 8 +----- .../download-client-settings.component.ts | 26 +++---------------- code/frontend/src/app/shared/models/enums.ts | 1 - 8 files changed, 10 insertions(+), 42 deletions(-) diff --git a/code/backend/Cleanuparr.Application/Features/DownloadClient/Dtos/CreateDownloadClientDto.cs b/code/backend/Cleanuparr.Application/Features/DownloadClient/Dtos/CreateDownloadClientDto.cs index 9b1aa6c2..5c5bda75 100644 --- a/code/backend/Cleanuparr.Application/Features/DownloadClient/Dtos/CreateDownloadClientDto.cs +++ b/code/backend/Cleanuparr.Application/Features/DownloadClient/Dtos/CreateDownloadClientDto.cs @@ -58,9 +58,9 @@ public sealed record CreateDownloadClientDto throw new ValidationException("Client name cannot be empty"); } - if (Host is null && TypeName is not DownloadClientTypeName.Usenet) + if (Host is null) { - throw new ValidationException("Host cannot be empty for non-Usenet clients"); + throw new ValidationException("Host cannot be empty"); } } } \ No newline at end of file diff --git a/code/backend/Cleanuparr.Domain/Enums/DownloadClientTypeName.cs b/code/backend/Cleanuparr.Domain/Enums/DownloadClientTypeName.cs index 0d376c81..266e31ac 100644 --- a/code/backend/Cleanuparr.Domain/Enums/DownloadClientTypeName.cs +++ b/code/backend/Cleanuparr.Domain/Enums/DownloadClientTypeName.cs @@ -5,5 +5,4 @@ public enum DownloadClientTypeName QBittorrent, Deluge, Transmission, - Usenet, } \ No newline at end of file diff --git a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/GenericHandler.cs b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/GenericHandler.cs index 249cafb3..fef6e2c3 100644 --- a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/GenericHandler.cs +++ b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/GenericHandler.cs @@ -263,11 +263,6 @@ public abstract class GenericHandler : IHandler foreach (var config in downloadClientConfigs) { - if (config.TypeName is DownloadClientTypeName.Usenet) - { - continue; - } - try { var downloadService = _downloadServiceFactory.GetDownloadService(config); diff --git a/code/backend/Cleanuparr.Infrastructure/Health/HealthCheckService.cs b/code/backend/Cleanuparr.Infrastructure/Health/HealthCheckService.cs index 7121f10c..983c8c68 100644 --- a/code/backend/Cleanuparr.Infrastructure/Health/HealthCheckService.cs +++ b/code/backend/Cleanuparr.Infrastructure/Health/HealthCheckService.cs @@ -112,7 +112,6 @@ public class HealthCheckService : IHealthCheckService // Get all enabled client configurations var enabledClients = await dataContext.DownloadClients .Where(x => x.Enabled) - .Where(x => x.TypeName != DownloadClientTypeName.Usenet) .ToListAsync(); var results = new Dictionary(); diff --git a/code/backend/Cleanuparr.Persistence/Models/Configuration/DownloadClientConfig.cs b/code/backend/Cleanuparr.Persistence/Models/Configuration/DownloadClientConfig.cs index dca67711..ab638256 100644 --- a/code/backend/Cleanuparr.Persistence/Models/Configuration/DownloadClientConfig.cs +++ b/code/backend/Cleanuparr.Persistence/Models/Configuration/DownloadClientConfig.cs @@ -74,12 +74,12 @@ public sealed record DownloadClientConfig { if (string.IsNullOrWhiteSpace(Name)) { - throw new ValidationException($"Client name cannot be empty for client ID: {Id}"); + throw new ValidationException($"Client name cannot be empty"); } - if (Host is null && TypeName is not DownloadClientTypeName.Usenet) + if (Host is null) { - throw new ValidationException($"Host cannot be empty for client ID: {Id}"); + throw new ValidationException($"Host cannot be empty"); } } } diff --git a/code/frontend/src/app/settings/download-client/download-client-settings.component.html b/code/frontend/src/app/settings/download-client/download-client-settings.component.html index b3b057c8..0828d107 100644 --- a/code/frontend/src/app/settings/download-client/download-client-settings.component.html +++ b/code/frontend/src/app/settings/download-client/download-client-settings.component.html @@ -152,8 +152,7 @@ Client type is required - - +
- - -
- Usenet client type is for categorization only. No connection details needed. -
diff --git a/code/frontend/src/app/settings/download-client/download-client-settings.component.ts b/code/frontend/src/app/settings/download-client/download-client-settings.component.ts index a4ebb373..a7e11397 100644 --- a/code/frontend/src/app/settings/download-client/download-client-settings.component.ts +++ b/code/frontend/src/app/settings/download-client/download-client-settings.component.ts @@ -59,7 +59,6 @@ export class DownloadClientSettingsComponent implements OnDestroy, CanComponentD { label: "qBittorrent", value: DownloadClientType.QBittorrent }, { label: "Deluge", value: DownloadClientType.Deluge }, { label: "Transmission", value: DownloadClientType.Transmission }, - { label: "Usenet", value: DownloadClientType.Usenet } ]; // Clean up subscriptions @@ -334,8 +333,6 @@ export class DownloadClientSettingsComponent implements OnDestroy, CanComponentD return { typeName: 'Deluge', type: 'Torrent' }; case DownloadClientType.Transmission: return { typeName: 'Transmission', type: 'Torrent' }; - case DownloadClientType.Usenet: - return { typeName: 'Usenet', type: 'Usenet' }; default: return { typeName: 'QBittorrent', type: 'Torrent' }; } @@ -352,20 +349,11 @@ export class DownloadClientSettingsComponent implements OnDestroy, CanComponentD return DownloadClientType.Deluge; case 'Transmission': return DownloadClientType.Transmission; - case 'Usenet': - return DownloadClientType.Usenet; default: return DownloadClientType.QBittorrent; } } - /** - * Checks if a client type is Usenet - */ - public isUsenetClient(clientType: DownloadClientType | null | undefined): boolean { - return clientType === DownloadClientType.Usenet; - } - /** * Handle client type changes to update validation */ @@ -375,16 +363,10 @@ export class DownloadClientSettingsComponent implements OnDestroy, CanComponentD if (!hostControl) return; - if (this.isUsenetClient(clientType)) { - // For Usenet, remove all validators - hostControl.clearValidators(); - } else { - // For other client types, add required and URI validators - hostControl.setValidators([ - Validators.required, - this.uriValidator.bind(this) - ]); - } + hostControl.setValidators([ + Validators.required, + this.uriValidator.bind(this) + ]); // Update validation state hostControl.updateValueAndValidity(); diff --git a/code/frontend/src/app/shared/models/enums.ts b/code/frontend/src/app/shared/models/enums.ts index c347ecbe..31d7718b 100644 --- a/code/frontend/src/app/shared/models/enums.ts +++ b/code/frontend/src/app/shared/models/enums.ts @@ -5,5 +5,4 @@ export enum DownloadClientType { QBittorrent = 0, Deluge = 1, Transmission = 2, - Usenet = 3, }