CategoryMapping: Add support for the tracker category description

This commit is contained in:
kaso17
2016-12-17 16:42:50 +01:00
parent 7b2dd93f2f
commit 5fc7fca5c6
4 changed files with 29 additions and 10 deletions

View File

@@ -13,6 +13,13 @@ namespace Jackett.Utils
{
public static string RFC1123ZPattern = "ddd, dd MMM yyyy HH':'mm':'ss z";
public static DateTime UnixTimestampToDateTime(long unixTime)
{
DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);
dt = dt.AddSeconds(unixTime).ToLocalTime();
return dt;
}
public static DateTime UnixTimestampToDateTime(double unixTime)
{
DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);
@@ -170,9 +177,7 @@ namespace Jackett.Utils
{
// try parsing the str as an unix timestamp
var unixTimeStamp = long.Parse(str);
DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);
dt = dt.AddSeconds(unixTimeStamp).ToLocalTime();
return dt;
return UnixTimestampToDateTime(unixTimeStamp);
}
catch (FormatException)
{