From e01741a69e2b1291839c99c5811931ce45a4d5dd Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 31 Dec 2024 16:33:19 +0200 Subject: [PATCH] New: (AnimeBytes) Use error message from response --- src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs b/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs index 30f084922..780278854 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/AnimeBytes.cs @@ -324,6 +324,11 @@ namespace NzbDrone.Core.Indexers.Definitions var response = STJson.Deserialize(indexerResponse.Content); + if (response.Error.IsNotNullOrWhiteSpace()) + { + throw new IndexerException(indexerResponse, "Unexpected response from indexer request: {0}", response.Error); + } + if (response.Matches == 0) { return releaseInfos.ToArray(); @@ -424,7 +429,7 @@ namespace NzbDrone.Core.Indexers.Definitions int? episode = null; var releaseInfo = _settings.EnableSonarrCompatibility && categoryName == "Anime" ? "S01" : ""; - var editionTitle = torrent.EditionData.EditionTitle; + var editionTitle = torrent.EditionData?.EditionTitle; if (editionTitle.IsNotNullOrWhiteSpace()) { @@ -758,6 +763,8 @@ namespace NzbDrone.Core.Indexers.Definitions [JsonPropertyName("Groups")] public IReadOnlyCollection Groups { get; set; } + + public string Error { get; set; } } public class AnimeBytesGroup