mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
avistaz: use timezone offset for publish dates
This commit is contained in:
@@ -25,6 +25,8 @@ namespace Jackett.Common.Indexers.Abstract
|
|||||||
|
|
||||||
public override bool SupportsPagination => true;
|
public override bool SupportsPagination => true;
|
||||||
|
|
||||||
|
protected virtual string TimezoneOffset => "-05:00"; // Avistaz does not specify a timezone & returns server time
|
||||||
|
|
||||||
private readonly Dictionary<string, string> AuthHeaders = new Dictionary<string, string>
|
private readonly Dictionary<string, string> AuthHeaders = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{"Accept", "application/json"},
|
{"Accept", "application/json"},
|
||||||
@@ -146,7 +148,7 @@ namespace Jackett.Common.Indexers.Abstract
|
|||||||
cacheService: cs,
|
cacheService: cs,
|
||||||
configData: new ConfigurationDataAvistazTracker())
|
configData: new ConfigurationDataAvistazTracker())
|
||||||
{
|
{
|
||||||
webclient.requestDelay = 3;
|
webclient.requestDelay = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
||||||
@@ -220,20 +222,6 @@ namespace Jackett.Common.Indexers.Abstract
|
|||||||
{
|
{
|
||||||
var details = new Uri(row.Value<string>("url"));
|
var details = new Uri(row.Value<string>("url"));
|
||||||
var link = new Uri(row.Value<string>("download"));
|
var link = new Uri(row.Value<string>("download"));
|
||||||
var publishDate = DateTime.ParseExact(row.Value<string>("created_at"), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
|
||||||
|
|
||||||
long? imdb = null;
|
|
||||||
long? tvdb = null;
|
|
||||||
long? tmdb = null;
|
|
||||||
var jMovieTv = row.Value<JToken>("movie_tv");
|
|
||||||
if (jMovieTv != null && jMovieTv.HasValues)
|
|
||||||
{
|
|
||||||
imdb = ParseUtil.GetImdbId(jMovieTv.Value<string>("imdb"));
|
|
||||||
if (long.TryParse(jMovieTv.Value<string>("tvdb"), out var tvdbParsed))
|
|
||||||
tvdb = tvdbParsed;
|
|
||||||
if (long.TryParse(jMovieTv.Value<string>("tmdb"), out var tmdbParsed))
|
|
||||||
tmdb = tmdbParsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
var description = "";
|
var description = "";
|
||||||
var jAudio = row.Value<JArray>("audio");
|
var jAudio = row.Value<JArray>("audio");
|
||||||
@@ -249,8 +237,6 @@ namespace Jackett.Common.Indexers.Abstract
|
|||||||
description += $"<br/>Subtitles: {string.Join(", ", subtitleList)}";
|
description += $"<br/>Subtitles: {string.Join(", ", subtitleList)}";
|
||||||
}
|
}
|
||||||
|
|
||||||
var cats = ParseCategories(query, row);
|
|
||||||
|
|
||||||
var release = new ReleaseInfo
|
var release = new ReleaseInfo
|
||||||
{
|
{
|
||||||
Title = row.Value<string>("file_name"),
|
Title = row.Value<string>("file_name"),
|
||||||
@@ -258,17 +244,14 @@ namespace Jackett.Common.Indexers.Abstract
|
|||||||
InfoHash = row.Value<string>("info_hash"),
|
InfoHash = row.Value<string>("info_hash"),
|
||||||
Details = details,
|
Details = details,
|
||||||
Guid = details,
|
Guid = details,
|
||||||
Category = cats,
|
Category = ParseCategories(query, row),
|
||||||
PublishDate = publishDate,
|
PublishDate = DateTime.Parse($"{row.Value<string>("created_at")} {TimezoneOffset}", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
|
||||||
Description = description,
|
Description = description,
|
||||||
Size = row.Value<long>("file_size"),
|
Size = row.Value<long>("file_size"),
|
||||||
Files = row.Value<long>("file_count"),
|
Files = row.Value<long>("file_count"),
|
||||||
Grabs = row.Value<long>("completed"),
|
Grabs = row.Value<long>("completed"),
|
||||||
Seeders = row.Value<int>("seed"),
|
Seeders = row.Value<int>("seed"),
|
||||||
Peers = row.Value<int>("leech") + row.Value<int>("seed"),
|
Peers = row.Value<int>("leech") + row.Value<int>("seed"),
|
||||||
Imdb = imdb,
|
|
||||||
TVDBId = tvdb,
|
|
||||||
TMDb = tmdb,
|
|
||||||
DownloadVolumeFactor = row.Value<double>("download_multiply"),
|
DownloadVolumeFactor = row.Value<double>("download_multiply"),
|
||||||
UploadVolumeFactor = row.Value<double>("upload_multiply"),
|
UploadVolumeFactor = row.Value<double>("upload_multiply"),
|
||||||
MinimumRatio = 1,
|
MinimumRatio = 1,
|
||||||
@@ -277,6 +260,22 @@ namespace Jackett.Common.Indexers.Abstract
|
|||||||
Subs = row.Value<JArray>("subtitle")?.Select(x => x.Value<string>("language")).ToList() ?? new List<string>(),
|
Subs = row.Value<JArray>("subtitle")?.Select(x => x.Value<string>("language")).ToList() ?? new List<string>(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var jMovieTv = row.Value<JToken>("movie_tv");
|
||||||
|
if (jMovieTv != null && jMovieTv.HasValues)
|
||||||
|
{
|
||||||
|
release.Imdb = ParseUtil.GetImdbId(jMovieTv.Value<string>("imdb"));
|
||||||
|
|
||||||
|
if (long.TryParse(jMovieTv.Value<string>("tvdb"), out var tvdbId))
|
||||||
|
{
|
||||||
|
release.TVDBId = tvdbId;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (long.TryParse(jMovieTv.Value<string>("tmdb"), out var tmdbId))
|
||||||
|
{
|
||||||
|
release.TMDb = tmdbId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,8 @@ namespace Jackett.Common.Indexers
|
|||||||
public override string Description => "Aka AsiaTorrents";
|
public override string Description => "Aka AsiaTorrents";
|
||||||
public override string SiteLink { get; protected set; } = "https://avistaz.to/";
|
public override string SiteLink { get; protected set; } = "https://avistaz.to/";
|
||||||
|
|
||||||
|
protected override string TimezoneOffset => "+01:00";
|
||||||
|
|
||||||
public override TorznabCapabilities TorznabCaps => SetCapabilities();
|
public override TorznabCapabilities TorznabCaps => SetCapabilities();
|
||||||
|
|
||||||
public AvistaZ(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
|
public AvistaZ(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
|
||||||
|
@@ -24,6 +24,8 @@ namespace Jackett.Common.Indexers
|
|||||||
"https://torrents.yourexotic.com/"
|
"https://torrents.yourexotic.com/"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
protected override string TimezoneOffset => "+01:00";
|
||||||
|
|
||||||
public override TorznabCapabilities TorznabCaps => SetCapabilities();
|
public override TorznabCapabilities TorznabCaps => SetCapabilities();
|
||||||
|
|
||||||
private new ConfigurationDataAvistazTracker configData => (ConfigurationDataAvistazTracker)base.configData;
|
private new ConfigurationDataAvistazTracker configData => (ConfigurationDataAvistazTracker)base.configData;
|
||||||
|
Reference in New Issue
Block a user