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)
* [ShowRSS](https://showrss.info/)
* [Torrentz](https://torrentz.eu/)
* [HD-Torrents.org](https://hd-torrents.org/)
### Additional Trackers

View File

@ -164,15 +164,29 @@ namespace Jackett.Indexers
release.Description = release.Title;
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.MinimumSeedTime = 172800;
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);
release.Peers = ParseUtil.TryCoerceInt(qRow.Find("td").Get(10).FirstChild.FirstChild.InnerText);
int seeders, peers;
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[] sizeSplit = fullSize.Split(' ');

View File

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

View File

@ -164,7 +164,9 @@
<Content Include="WebContent\logos\animebytes.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="WebContent\logos\hdtorrents.png" />
<Content Include="WebContent\logos\hdtorrents.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="WebContent\logos\sceneaccess.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</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;
float.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out val);
return val;
return float.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
}
public static int TryCoerceInt(string str)
public static bool TryCoerceInt(string str, out int result)
{
int val;
int.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out val);
return val;
return int.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
}
public static long TryCoerceLong(string str)
public static bool TryCoerceLong(string str, out long result)
{
long val;
long.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out val);
return val;
return long.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out result);
}
}

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 26 KiB