New: (AnimeBytes) Use error message from response

pull/2195/merge
Bogdan 1 week ago
parent 1dbff1235e
commit e01741a69e

@ -324,6 +324,11 @@ namespace NzbDrone.Core.Indexers.Definitions
var response = STJson.Deserialize<AnimeBytesResponse>(indexerResponse.Content); var response = STJson.Deserialize<AnimeBytesResponse>(indexerResponse.Content);
if (response.Error.IsNotNullOrWhiteSpace())
{
throw new IndexerException(indexerResponse, "Unexpected response from indexer request: {0}", response.Error);
}
if (response.Matches == 0) if (response.Matches == 0)
{ {
return releaseInfos.ToArray(); return releaseInfos.ToArray();
@ -424,7 +429,7 @@ namespace NzbDrone.Core.Indexers.Definitions
int? episode = null; int? episode = null;
var releaseInfo = _settings.EnableSonarrCompatibility && categoryName == "Anime" ? "S01" : ""; var releaseInfo = _settings.EnableSonarrCompatibility && categoryName == "Anime" ? "S01" : "";
var editionTitle = torrent.EditionData.EditionTitle; var editionTitle = torrent.EditionData?.EditionTitle;
if (editionTitle.IsNotNullOrWhiteSpace()) if (editionTitle.IsNotNullOrWhiteSpace())
{ {
@ -758,6 +763,8 @@ namespace NzbDrone.Core.Indexers.Definitions
[JsonPropertyName("Groups")] [JsonPropertyName("Groups")]
public IReadOnlyCollection<AnimeBytesGroup> Groups { get; set; } public IReadOnlyCollection<AnimeBytesGroup> Groups { get; set; }
public string Error { get; set; }
} }
public class AnimeBytesGroup public class AnimeBytesGroup

Loading…
Cancel
Save