From ef99687187e6d8689d7809b42ce858c0bfd5e002 Mon Sep 17 00:00:00 2001 From: flightlevel Date: Fri, 26 Aug 2016 17:21:04 +1000 Subject: [PATCH] AlphaRatio: Fix Time (#471) AlphaRatio: Fix Time --- src/Jackett/Indexers/AlphaRatio.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Jackett/Indexers/AlphaRatio.cs b/src/Jackett/Indexers/AlphaRatio.cs index 5aff7ddfa..85d76f745 100644 --- a/src/Jackett/Indexers/AlphaRatio.cs +++ b/src/Jackett/Indexers/AlphaRatio.cs @@ -30,7 +30,7 @@ namespace Jackett.Indexers : base(name: "AlphaRatio", description: "Legendary", link: "https://alpharatio.cc/", - caps: TorznabUtil.CreateDefaultTorznabTVCaps(), + caps: new TorznabCapabilities(), manager: i, client: w, logger: l, @@ -93,6 +93,7 @@ namespace Jackett.Indexers release.Guid = new Uri(GuidUrl + id); release.Comments = release.Guid; release.Link = new Uri(DownloadUrl + id); + release.Category = MapTrackerCatToNewznab(CategoryReverseMapper((string)r["category"])); } public async Task> PerformQuery(TorznabQuery query) @@ -164,7 +165,23 @@ namespace Jackett.Indexers { DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); long unixTimeStampInTicks = (long)(unixTime * TimeSpan.TicksPerSecond); - return new DateTime(unixStart.Ticks + unixTimeStampInTicks); + return new DateTime(unixStart.Ticks + unixTimeStampInTicks, DateTimeKind.Utc).ToLocalTime(); + } + + static string CategoryReverseMapper(string categoryName) + { + Dictionary dictionary = new Dictionary(); + + dictionary.Add("TvSD", "1"); + dictionary.Add("TvHD", "2"); + dictionary.Add("MovieSD", "6"); + dictionary.Add("MovieHD", "7"); + + if (dictionary.ContainsKey(categoryName)) + { + return dictionary[categoryName]; + } + return string.Empty; } } }