diff --git a/code/Common/Attributes/DryRunSafeguardAttribute.cs b/code/Common/Attributes/DryRunSafeguardAttribute.cs deleted file mode 100644 index 2f5fa091..00000000 --- a/code/Common/Attributes/DryRunSafeguardAttribute.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Common.Attributes; - -[AttributeUsage(AttributeTargets.Method, Inherited = true)] -public class DryRunSafeguardAttribute : Attribute -{ -} \ No newline at end of file diff --git a/code/Infrastructure/Events/EventPublisher.cs b/code/Infrastructure/Events/EventPublisher.cs index af8a3563..5f68ca6a 100644 --- a/code/Infrastructure/Events/EventPublisher.cs +++ b/code/Infrastructure/Events/EventPublisher.cs @@ -7,7 +7,6 @@ using Data.Models.Events; using Infrastructure.Verticals.Notifications; using Infrastructure.Verticals.Context; using Infrastructure.Interceptors; -using Common.Attributes; using Infrastructure.Hubs; namespace Infrastructure.Events; @@ -146,7 +145,6 @@ public class EventPublisher await _notificationPublisher.NotifyCategoryChanged(oldCategory, newCategory, isTag); } - [DryRunSafeguard] private async Task SaveEventToDatabase(AppEvent eventEntity) { _context.Events.Add(eventEntity); diff --git a/code/Infrastructure/Verticals/Arr/ArrClient.cs b/code/Infrastructure/Verticals/Arr/ArrClient.cs index 49463b38..804667f6 100644 --- a/code/Infrastructure/Verticals/Arr/ArrClient.cs +++ b/code/Infrastructure/Verticals/Arr/ArrClient.cs @@ -1,4 +1,3 @@ -using Common.Attributes; using Data.Models.Configuration.Arr; using Data.Models.Configuration.QueueCleaner; using Common.Helpers; @@ -198,7 +197,6 @@ public abstract class ArrClient : IArrClient request.Headers.Add("x-api-key", apiKey); } - [DryRunSafeguard] protected virtual async Task SendRequestAsync(HttpRequestMessage request) { HttpResponseMessage response = await _httpClient.SendAsync(request); diff --git a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceDC.cs b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceDC.cs index 7b7a3229..9e47eddf 100644 --- a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceDC.cs +++ b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceDC.cs @@ -1,5 +1,4 @@ -using Common.Attributes; -using Data.Models.Configuration.DownloadCleaner; +using Data.Models.Configuration.DownloadCleaner; using Data.Enums; using Data.Models.Deluge.Response; using Infrastructure.Extensions; @@ -207,7 +206,6 @@ public partial class DelugeService } /// - [DryRunSafeguard] public override async Task DeleteDownload(string hash) { hash = hash.ToLowerInvariant(); @@ -215,13 +213,11 @@ public partial class DelugeService await _client.DeleteTorrents([hash]); } - [DryRunSafeguard] protected async Task CreateLabel(string name) { await _client.CreateLabel(name); } - [DryRunSafeguard] protected virtual async Task ChangeLabel(string hash, string newLabel) { await _client.SetTorrentLabel(hash, newLabel); diff --git a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceQC.cs b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceQC.cs index 3e600f43..91c21cc8 100644 --- a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceQC.cs +++ b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeServiceQC.cs @@ -1,6 +1,5 @@ using System.Collections.Concurrent; using System.Text.RegularExpressions; -using Common.Attributes; using Data.Models.Configuration.QueueCleaner; using Common.CustomDataTypes; using Data.Enums; @@ -158,7 +157,6 @@ public partial class DelugeService return (false, DeleteReason.None); } - [DryRunSafeguard] protected virtual async Task ChangeFilesPriority(string hash, List sortedPriorities) { await _client.ChangeFilesPriority(hash, sortedPriorities); diff --git a/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceDC.cs b/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceDC.cs index 880fbe78..5ffba0ad 100644 --- a/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceDC.cs +++ b/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceDC.cs @@ -273,7 +273,6 @@ public partial class QBitService } /// - [DryRunSafeguard] public override async Task DeleteDownload(string hash) { if (_client == null) @@ -284,7 +283,6 @@ public partial class QBitService await _client.DeleteAsync([hash], deleteDownloadedData: true); } - [DryRunSafeguard] protected async Task CreateCategory(string name) { if (_client == null) @@ -295,7 +293,6 @@ public partial class QBitService await _client.AddCategoryAsync(name); } - [DryRunSafeguard] protected virtual async Task ChangeCategory(string hash, string newCategory) { if (_client == null) diff --git a/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceQC.cs b/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceQC.cs index f2247491..19018508 100644 --- a/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceQC.cs +++ b/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitServiceQC.cs @@ -1,6 +1,5 @@ using System.Collections.Concurrent; using System.Text.RegularExpressions; -using Common.Attributes; using Data.Models.Configuration.QueueCleaner; using Common.CustomDataTypes; using Data.Enums; @@ -158,7 +157,6 @@ public partial class QBitService return (false, DeleteReason.None); } - [DryRunSafeguard] protected virtual async Task MarkFileAsSkipped(string hash, int fileIndex) { await _client.SetFilePriorityAsync(hash, fileIndex, TorrentContentPriority.Skip); diff --git a/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceDC.cs b/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceDC.cs index 3b062933..80a54180 100644 --- a/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceDC.cs +++ b/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceDC.cs @@ -1,5 +1,4 @@ -using Common.Attributes; -using Data.Models.Configuration.DownloadCleaner; +using Data.Models.Configuration.DownloadCleaner; using Data.Enums; using Infrastructure.Extensions; using Infrastructure.Verticals.Context; @@ -215,7 +214,6 @@ public partial class TransmissionService } } - [DryRunSafeguard] protected virtual async Task ChangeDownloadLocation(long downloadId, string newLocation) { await _client.TorrentSetLocationAsync([downloadId], newLocation, true); @@ -233,7 +231,6 @@ public partial class TransmissionService await _client.TorrentRemoveAsync([torrent.Id], true); } - [DryRunSafeguard] protected virtual async Task RemoveDownloadAsync(long downloadId) { await _client.TorrentRemoveAsync([downloadId], true); diff --git a/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceQC.cs b/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceQC.cs index c8211d77..892cf99c 100644 --- a/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceQC.cs +++ b/code/Infrastructure/Verticals/DownloadClient/Transmission/TransmissionServiceQC.cs @@ -1,6 +1,5 @@ using System.Collections.Concurrent; using System.Text.RegularExpressions; -using Common.Attributes; using Data.Models.Configuration.QueueCleaner; using Common.CustomDataTypes; using Data.Enums; @@ -150,7 +149,6 @@ public partial class TransmissionService return (false, DeleteReason.None); } - [DryRunSafeguard] protected virtual async Task SetUnwantedFiles(long downloadId, long[] unwantedFiles) { await _client.TorrentSetAsync(new TorrentSettings diff --git a/code/Infrastructure/Verticals/Notifications/NotificationPublisher.cs b/code/Infrastructure/Verticals/Notifications/NotificationPublisher.cs index be254d49..ba12dbbe 100644 --- a/code/Infrastructure/Verticals/Notifications/NotificationPublisher.cs +++ b/code/Infrastructure/Verticals/Notifications/NotificationPublisher.cs @@ -1,5 +1,4 @@ using System.Globalization; -using Common.Attributes; using Data.Models.Configuration.Arr; using Data.Enums; using Data.Models.Arr.Queue; @@ -154,7 +153,6 @@ public class NotificationPublisher : INotificationPublisher return _dryRunInterceptor.InterceptAsync(Notify, message); } - [DryRunSafeguard] private Task Notify(T message) where T: notnull { return _messageBus.Publish(message);