mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-01-02 02:47:52 -05:00
29 lines
833 B
C#
29 lines
833 B
C#
using Domain.Models.Deluge.Response;
|
|
|
|
namespace Infrastructure.Extensions;
|
|
|
|
public static class DelugeExtensions
|
|
{
|
|
public static bool ShouldIgnore(this TorrentStatus download, IReadOnlyList<string> ignoredDownloads)
|
|
{
|
|
foreach (string value in ignoredDownloads)
|
|
{
|
|
if (download.Hash?.Equals(value, StringComparison.InvariantCultureIgnoreCase) ?? false)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
if (download.Label?.Equals(value, StringComparison.InvariantCultureIgnoreCase) ?? false)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
if (download.Trackers.Any(x => x.Url.Host.EndsWith(value, StringComparison.InvariantCultureIgnoreCase)))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
} |