From 4321c1d40ce64358b82a90bb46c29c8a272a2630 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sat, 28 Dec 2024 23:42:14 +0200 Subject: [PATCH] Catch search engine related error messages for MyAnonaMouse --- src/NzbDrone.Core/Indexers/Definitions/MyAnonamouse.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/MyAnonamouse.cs b/src/NzbDrone.Core/Indexers/Definitions/MyAnonamouse.cs index 94a41a699..ce80fbb74 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/MyAnonamouse.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/MyAnonamouse.cs @@ -441,6 +441,11 @@ namespace NzbDrone.Core.Indexers.Definitions return releaseInfos.ToArray(); } + if (jsonResponse.Data == null) + { + throw new IndexerException(indexerResponse, "Unexpected response content from indexer request: {0}", jsonResponse.Message ?? "Check the logs for more information."); + } + var hasUserVip = HasUserVip(httpResponse.GetCookies()); foreach (var item in jsonResponse.Data) @@ -655,7 +660,8 @@ namespace NzbDrone.Core.Indexers.Definitions public class MyAnonamouseResponse { public string Error { get; set; } - public List Data { get; set; } + public IReadOnlyCollection Data { get; set; } + public string Message { get; set; } } public class MyAnonamouseBuyPersonalFreeleechResponse