From 5f57957462db5c9997da4b38328cb6841d631d1e Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 13 Apr 2023 01:13:03 +0300 Subject: [PATCH] Fixed: (AnimeBytes) Improve release group detection --- .../Indexers/Definitions/AnimeBytes.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs b/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs index edfb00fe5..fd2c0896c 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs @@ -228,6 +228,14 @@ namespace NzbDrone.Core.Indexers.Definitions "Freeleech" }; + private readonly HashSet _commonReleaseGroupsProperties = new (StringComparer.OrdinalIgnoreCase) + { + "Softsubs", + "Hardsubs", + "RAW", + "Translated" + }; + public AnimeBytesParser(AnimeBytesSettings settings) { _settings = settings; @@ -321,9 +329,9 @@ namespace NzbDrone.Core.Indexers.Definitions .Split('|', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) .ToList(); - properties.RemoveAll(p => _excludedProperties.Any(p.Contains)); + properties.RemoveAll(p => _excludedProperties.Any(p.ContainsIgnoreCase)); - if (_settings.ExcludeRaw && properties.ContainsIgnoreCase("RAW")) + if (_settings.ExcludeRaw && properties.Any(p => p.StartsWithIgnoreCase("RAW"))) { continue; } @@ -449,7 +457,7 @@ namespace NzbDrone.Core.Indexers.Definitions } // We don't actually have a release name >.> so try to create one - var releaseGroup = properties.LastOrDefault(p => !p.ContainsIgnoreCase("Hentai")); + var releaseGroup = properties.LastOrDefault(p => _commonReleaseGroupsProperties.Any(p.StartsWithIgnoreCase)); if (releaseGroup.IsNotNullOrWhiteSpace() && releaseGroup.Contains('(') && releaseGroup.Contains(')')) {