mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-02-18 14:54:54 -05:00
removed dry run attribute
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace Common.Attributes;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = true)]
|
||||
public class DryRunSafeguardAttribute : Attribute
|
||||
{
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user