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