Minor improvements, bug fixes

This commit is contained in:
unknown 2015-07-12 13:50:24 -06:00
parent 34aa6eb9fe
commit a2fd26dcdc
7 changed files with 30 additions and 17 deletions

View File

@ -36,6 +36,7 @@ Download in the [Releases page](https://github.com/zone117x/Jackett/releases)
* [SceneAccess](https://sceneaccess.eu/login) * [SceneAccess](https://sceneaccess.eu/login)
* [ShowRSS](https://showrss.info/) * [ShowRSS](https://showrss.info/)
* [Torrentz](https://torrentz.eu/) * [Torrentz](https://torrentz.eu/)
* [HD-Torrents.org](https://hd-torrents.org/)
### Additional Trackers ### Additional Trackers

View File

@ -164,15 +164,29 @@ namespace Jackett.Indexers
release.Description = release.Title; release.Description = release.Title;
if (0 != qRow.Find("td.mainblockcontent u").Length) if (0 != qRow.Find("td.mainblockcontent u").Length)
release.Imdb = ParseUtil.TryCoerceLong(qRow.Find("td.mainblockcontent u").Parent().First().Attr("href").Replace("http://www.imdb.com/title/tt", "").Replace("/", "")); {
var imdbStr = qRow.Find("td.mainblockcontent u").Parent().First().Attr("href").Replace("http://www.imdb.com/title/tt", "").Replace("/", "");
long imdb;
if (ParseUtil.TryCoerceLong(imdbStr, out imdb))
{
release.Imdb = imdb;
}
}
release.MinimumRatio = 1; release.MinimumRatio = 1;
release.MinimumSeedTime = 172800; release.MinimumSeedTime = 172800;
release.MagnetUri = new Uri(DefaultUrl + "/" + qRow.Find("td.mainblockcontent").Get(3).FirstChild.GetAttribute("href")); release.MagnetUri = new Uri(DefaultUrl + "/" + qRow.Find("td.mainblockcontent").Get(3).FirstChild.GetAttribute("href"));
release.Seeders = ParseUtil.TryCoerceInt(qRow.Find("td").Get(9).FirstChild.FirstChild.InnerText); int seeders, peers;
release.Peers = ParseUtil.TryCoerceInt(qRow.Find("td").Get(10).FirstChild.FirstChild.InnerText); if (ParseUtil.TryCoerceInt(qRow.Find("td").Get(9).FirstChild.FirstChild.InnerText, out seeders))
{
release.Seeders = seeders;
if (ParseUtil.TryCoerceInt(qRow.Find("td").Get(10).FirstChild.FirstChild.InnerText, out peers))
{
release.Peers = peers + release.Seeders;
}
}
string fullSize = qRow.Find("td.mainblockcontent").Get(6).InnerText; string fullSize = qRow.Find("td.mainblockcontent").Get(6).InnerText;
string[] sizeSplit = fullSize.Split(' '); string[] sizeSplit = fullSize.Split(' ');

View File

@ -144,7 +144,7 @@ namespace Jackett.Indexers
release.InfoHash = td.hash; release.InfoHash = td.hash;
release.Size = td.Size; release.Size = td.Size;
release.Seeders = td.Seeders; release.Seeders = td.Seeders;
release.Peers = td.Peers; release.Peers = td.Peers + release.Seeders;
release.MagnetUri = TorrentzHelper.createMagnetLink(td.hash, serie_title); release.MagnetUri = TorrentzHelper.createMagnetLink(td.hash, serie_title);
releases.Add(release); releases.Add(release);
} }

View File

@ -164,7 +164,9 @@
<Content Include="WebContent\logos\animebytes.png"> <Content Include="WebContent\logos\animebytes.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="WebContent\logos\hdtorrents.png" /> <Content Include="WebContent\logos\hdtorrents.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="WebContent\logos\sceneaccess.png"> <Content Include="WebContent\logos\sceneaccess.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

View File

@ -25,25 +25,19 @@ namespace Jackett
} }
public static float TryCoerceFloat(string str) public static bool TryCoerceFloat(string str, out float result)
{ {
float val; return float.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
float.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out val);
return val;
} }
public static int TryCoerceInt(string str) public static bool TryCoerceInt(string str, out int result)
{ {
int val; return int.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
int.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out val);
return val;
} }
public static long TryCoerceLong(string str) public static bool TryCoerceLong(string str, out long result)
{ {
long val; return long.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
long.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out val);
return val;
} }
} }

View File

@ -90,7 +90,9 @@ namespace Jackett
} }
} }
else else
{
Program.LoggerInstance.FatalException("Failed to start HTTP server. " + ex.Message, ex); Program.LoggerInstance.FatalException("Failed to start HTTP server. " + ex.Message, ex);
}
} }
catch (Exception ex) catch (Exception ex)
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 26 KiB