removed dry run attribute

This commit is contained in:
Flaminel
2025-06-16 23:14:10 +03:00
parent fe54813abf
commit 84dd43a85a
10 changed files with 2 additions and 30 deletions

View File

@@ -1,6 +0,0 @@
namespace Common.Attributes;
[AttributeUsage(AttributeTargets.Method, Inherited = true)]
public class DryRunSafeguardAttribute : Attribute
{
}

View File

@@ -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);

View File

@@ -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<HttpResponseMessage> SendRequestAsync(HttpRequestMessage request)
{
HttpResponseMessage response = await _httpClient.SendAsync(request);

View File

@@ -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
}
/// <inheritdoc/>
[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);

View File

@@ -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<int> sortedPriorities)
{
await _client.ChangeFilesPriority(hash, sortedPriorities);

View File

@@ -273,7 +273,6 @@ public partial class QBitService
}
/// <inheritdoc/>
[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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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

View File

@@ -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<T>, message);
}
[DryRunSafeguard]
private Task Notify<T>(T message) where T: notnull
{
return _messageBus.Publish(message);