Fixed the SickRage/Medusa Issue where it was always being set as Skipped/Ignore #2084

pull/2292/head
Jamie 6 years ago
parent c354efb500
commit 3be460ea3b

@ -314,9 +314,17 @@ namespace Ombi.Core.Senders
foreach (var seasonRequests in model.SeasonRequests) foreach (var seasonRequests in model.SeasonRequests)
{ {
var srEpisodes = await SickRageApi.GetEpisodesForSeason(tvdbid, seasonRequests.SeasonNumber, settings.ApiKey, settings.FullUri); 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)); await Task.Delay(TimeSpan.FromSeconds(1));
currentRetry++;
srEpisodes = await SickRageApi.GetEpisodesForSeason(tvdbid, seasonRequests.SeasonNumber, settings.ApiKey, settings.FullUri); srEpisodes = await SickRageApi.GetEpisodesForSeason(tvdbid, seasonRequests.SeasonNumber, settings.ApiKey, settings.FullUri);
} }

Loading…
Cancel
Save