From 3be460ea3b557101dd2cb25a4636d95f73309fd2 Mon Sep 17 00:00:00 2001 From: Jamie Date: Fri, 1 Jun 2018 13:23:53 +0100 Subject: [PATCH] Fixed the SickRage/Medusa Issue where it was always being set as Skipped/Ignore #2084 --- src/Ombi.Core/Senders/TvSender.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Ombi.Core/Senders/TvSender.cs b/src/Ombi.Core/Senders/TvSender.cs index 151ad0f7b..12124d270 100644 --- a/src/Ombi.Core/Senders/TvSender.cs +++ b/src/Ombi.Core/Senders/TvSender.cs @@ -314,9 +314,17 @@ namespace Ombi.Core.Senders foreach (var seasonRequests in model.SeasonRequests) { var srEpisodes = await SickRageApi.GetEpisodesForSeason(tvdbid, seasonRequests.SeasonNumber, settings.ApiKey, settings.FullUri); - while (srEpisodes.message.Equals("Show not found", StringComparison.CurrentCultureIgnoreCase) && srEpisodes.data.Count <= 0) + int retryTimes = 10; + var currentRetry = 0; + while (srEpisodes.message.Equals("Show not found", StringComparison.CurrentCultureIgnoreCase) || srEpisodes.message.Equals("Season not found", StringComparison.CurrentCultureIgnoreCase) && srEpisodes.data.Count <= 0) { + if (currentRetry > retryTimes) + { + Logger.LogWarning("Couldnt find the SR Season or Show, message: {0}", srEpisodes.message); + break; + } await Task.Delay(TimeSpan.FromSeconds(1)); + currentRetry++; srEpisodes = await SickRageApi.GetEpisodesForSeason(tvdbid, seasonRequests.SeasonNumber, settings.ApiKey, settings.FullUri); }