From 29c3d2aa6dc2070360a89d89997e245860d8a539 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 14 Dec 2023 20:33:36 +0200 Subject: [PATCH] avistaz: disable pagination, increase rate limit and implement MST formula --- .../Indexers/Abstract/AvistazTracker.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs b/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs index 2a816aadc..e4cf01767 100644 --- a/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/AvistazTracker.cs @@ -23,7 +23,7 @@ namespace Jackett.Common.Indexers.Abstract public override string Language => "en-US"; public override string Type => "private"; - public override bool SupportsPagination => true; + public override bool SupportsPagination => false; protected virtual string TimezoneOffset => "-05:00"; // Avistaz does not specify a timezone & returns server time @@ -148,7 +148,7 @@ namespace Jackett.Common.Indexers.Abstract cacheService: cs, configData: new ConfigurationDataAvistazTracker()) { - webclient.requestDelay = 5; + webclient.requestDelay = 6; } public override async Task ApplyConfiguration(JToken configJson) @@ -255,11 +255,20 @@ namespace Jackett.Common.Indexers.Abstract DownloadVolumeFactor = row.Value("download_multiply"), UploadVolumeFactor = row.Value("upload_multiply"), MinimumRatio = 1, - MinimumSeedTime = 172800, // 48 hours + MinimumSeedTime = 259200, // 72 hours Languages = row.Value("audio")?.Select(x => x.Value("language")).ToList() ?? new List(), Subs = row.Value("subtitle")?.Select(x => x.Value("language")).ToList() ?? new List(), }; + if (release.Size.HasValue && release.Size > 0) + { + var sizeGigabytes = release.Size.Value / Math.Pow(1024, 3); + + release.MinimumSeedTime = sizeGigabytes > 50.0 + ? (long)((100 * Math.Log(sizeGigabytes)) - 219.2023) * 3600 + : 259200 + (long)(sizeGigabytes * 7200); + } + var jMovieTv = row.Value("movie_tv"); if (jMovieTv != null && jMovieTv.HasValues) {