Added retry logic to morethantv

This commit is contained in:
zone117x 2015-05-25 17:50:20 -06:00
parent f2749ed311
commit c9df7bc47a
1 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
@ -49,6 +50,7 @@ namespace Jackett.Indexers
HttpClient client;
string cookieHeader;
int retries = 3;
public MoreThanTV()
{
@ -129,7 +131,7 @@ namespace Jackett.Indexers
IsConfigured = true;
}
void FillReleaseInfoFromJson(ReleaseInfo release, JObject r)
static void FillReleaseInfoFromJson(ReleaseInfo release, JObject r)
{
var id = r["torrentId"];
release.Size = (long)r["size"];
@ -153,7 +155,7 @@ namespace Jackett.Indexers
string results;
if (Program.IsWindows)
{
results = await client.GetStringAsync(episodeSearchUrl);
results = await client.GetStringAsync(episodeSearchUrl, retries);
}
else
{
@ -227,6 +229,5 @@ namespace Jackett.Indexers
}
}
}
}