From c7dfde0ce99eec2280a92f88a726f3a9b7c61ecb Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 19 Jul 2024 19:49:05 +0300 Subject: [PATCH] Improve messaging for invalid request for M-Team-TP --- src/NzbDrone.Core/Indexers/Definitions/MTeamTp.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/NzbDrone.Core/Indexers/Definitions/MTeamTp.cs b/src/NzbDrone.Core/Indexers/Definitions/MTeamTp.cs index cc292ce02..eec5203f2 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/MTeamTp.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/MTeamTp.cs @@ -338,6 +338,13 @@ public class MTeamTpParser : IParseIndexerResponse if (jsonResponse?.Data?.Torrents == null) { + if (jsonResponse != null && + jsonResponse.Message.IsNotNullOrWhiteSpace() && + jsonResponse.Message.ToUpperInvariant() != "SUCCESS") + { + throw new IndexerException(indexerResponse, $"Invalid response received from M-Team. Response from API: {jsonResponse.Message}"); + } + return releaseInfos; } @@ -464,6 +471,7 @@ internal class MTeamTpApiSearchQuery internal class MTeamTpApiResponse { public MTeamTpApiData Data { get; set; } + public string Message { get; set; } } internal class MTeamTpApiData