mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 01:32:55 -07:00
Fixed async issue
This commit is contained in:
parent
6921e3aa85
commit
eae8d5fee8
1 changed files with 4 additions and 19 deletions
|
@ -79,11 +79,13 @@ namespace PlexRequests.Api
|
|||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
// Check to see if it's been added yet.
|
||||
var seasonIncrement = 0;
|
||||
var seasonList = new SickRageSeasonList();
|
||||
while (seasonList.data.Length < seasonCount)
|
||||
while (seasonIncrement < seasonCount)
|
||||
{
|
||||
seasonList = VerifyShowHasLoaded(tvdbId, apiKey, baseUrl);
|
||||
seasonIncrement = seasonList.data?.Length ?? 0;
|
||||
|
||||
if (sw.ElapsedMilliseconds > 30000) // Break out after 30 seconds, it's not going to get added
|
||||
{
|
||||
Log.Warn("Couldn't find out if the show had been added after 10 seconds. I doubt we can change the status to wanted.");
|
||||
|
@ -92,7 +94,6 @@ namespace PlexRequests.Api
|
|||
}
|
||||
sw.Stop();
|
||||
}
|
||||
|
||||
if (seasons.Length > 0)
|
||||
{
|
||||
//handle the seasons requested
|
||||
|
@ -151,21 +152,5 @@ namespace PlexRequests.Api
|
|||
await Task.Run(() => Thread.Sleep(2000));
|
||||
return await Task.Run(() => Api.Execute<SickRageTvAdd>(request, baseUrl)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
||||
//public SickRageShowInformation CheckShowHasBeenAdded(int tvdbId, string apiKey, Uri baseUrl)
|
||||
//{
|
||||
// var request = new RestRequest
|
||||
// {
|
||||
// Resource = "/api/{apiKey}/?cmd=show",
|
||||
// Method = Method.GET
|
||||
// };
|
||||
// request.AddUrlSegment("apiKey", apiKey);
|
||||
// request.AddQueryParameter("tvdbid", tvdbId.ToString());
|
||||
|
||||
// var obj = Api.Execute<SickRageShowInformation>(request, baseUrl);
|
||||
|
||||
// return obj;
|
||||
//}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue