Fixed: (RetroFlix) Set 5 days as MST, return 100 results and remove "[REQUESTED]" from title

pull/1275/head
Bogdan 2 years ago committed by Qstick
parent f386ddb806
commit c60a94adfb

@ -14,6 +14,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public override string Description => "Private Torrent Tracker for Classic Movies / TV / General Releases"; public override string Description => "Private Torrent Tracker for Classic Movies / TV / General Releases";
public override IndexerPrivacy Privacy => IndexerPrivacy.Private; public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
public override TimeSpan RateLimit => TimeSpan.FromSeconds(2.1); public override TimeSpan RateLimit => TimeSpan.FromSeconds(2.1);
protected override int MinimumSeedTime => 432000; // 120 hours
public RetroFlix(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger, IIndexerRepository indexerRepository) public RetroFlix(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger, IIndexerRepository indexerRepository)
: base(httpClient, eventAggregator, indexerStatusService, configService, logger, indexerRepository) : base(httpClient, eventAggregator, indexerStatusService, configService, logger, indexerRepository)

@ -6,6 +6,7 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Net.Mime; using System.Net.Mime;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using FluentValidation; using FluentValidation;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -21,7 +22,6 @@ using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions namespace NzbDrone.Core.Indexers.Definitions
@ -32,7 +32,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public override Encoding Encoding => Encoding.UTF8; public override Encoding Encoding => Encoding.UTF8;
public override DownloadProtocol Protocol => DownloadProtocol.Torrent; public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
public override IndexerCapabilities Capabilities => SetCapabilities(); public override IndexerCapabilities Capabilities => SetCapabilities();
protected virtual int MinimumSeedTime => 172800; // 48 hours
private IIndexerRepository _indexerRepository; private IIndexerRepository _indexerRepository;
public SpeedAppBase(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger, IIndexerRepository indexerRepository) public SpeedAppBase(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger, IIndexerRepository indexerRepository)
@ -48,7 +48,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public override IParseIndexerResponse GetParser() public override IParseIndexerResponse GetParser()
{ {
return new SpeedAppParser(Settings, Capabilities.Categories); return new SpeedAppParser(Settings, Capabilities.Categories, MinimumSeedTime);
} }
protected override bool CheckIfLoginNeeded(HttpResponse httpResponse) protected override bool CheckIfLoginNeeded(HttpResponse httpResponse)
@ -226,7 +226,12 @@ namespace NzbDrone.Core.Indexers.Definitions
private IEnumerable<IndexerRequest> GetPagedRequests(string term, int[] categories, string imdbId = null, int? season = null, string episode = null) private IEnumerable<IndexerRequest> GetPagedRequests(string term, int[] categories, string imdbId = null, int? season = null, string episode = null)
{ {
var qc = new NameValueCollection(); var qc = new NameValueCollection()
{
{ "itemsPerPage", "100" },
{ "sort", "torrent.createdAt" },
{ "direction", "desc" }
};
if (imdbId.IsNotNullOrWhiteSpace()) if (imdbId.IsNotNullOrWhiteSpace())
{ {
@ -271,13 +276,15 @@ namespace NzbDrone.Core.Indexers.Definitions
{ {
private readonly SpeedAppSettings _settings; private readonly SpeedAppSettings _settings;
private readonly IndexerCapabilitiesCategories _categories; private readonly IndexerCapabilitiesCategories _categories;
private readonly int _minimumSeedTime;
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; } public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
public SpeedAppParser(SpeedAppSettings settings, IndexerCapabilitiesCategories categories) public SpeedAppParser(SpeedAppSettings settings, IndexerCapabilitiesCategories categories, int minimumSeedTime)
{ {
_settings = settings; _settings = settings;
_categories = categories; _categories = categories;
_minimumSeedTime = minimumSeedTime;
} }
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse) public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
@ -297,7 +304,7 @@ namespace NzbDrone.Core.Indexers.Definitions
return jsonResponse.Resource.Select(torrent => new TorrentInfo return jsonResponse.Resource.Select(torrent => new TorrentInfo
{ {
Guid = torrent.Id.ToString(), Guid = torrent.Id.ToString(),
Title = torrent.Name, Title = Regex.Replace(torrent.Name, @"(?i:\[REQUESTED\])", "").Trim(' ', '.'),
Description = torrent.ShortDescription, Description = torrent.ShortDescription,
Size = torrent.Size, Size = torrent.Size,
ImdbId = ParseUtil.GetImdbID(torrent.ImdbId).GetValueOrDefault(), ImdbId = ParseUtil.GetImdbID(torrent.ImdbId).GetValueOrDefault(),
@ -311,7 +318,7 @@ namespace NzbDrone.Core.Indexers.Definitions
Seeders = torrent.Seeders, Seeders = torrent.Seeders,
Peers = torrent.Leechers + torrent.Seeders, Peers = torrent.Leechers + torrent.Seeders,
MinimumRatio = 1, MinimumRatio = 1,
MinimumSeedTime = 172800, MinimumSeedTime = _minimumSeedTime,
DownloadVolumeFactor = torrent.DownloadVolumeFactor, DownloadVolumeFactor = torrent.DownloadVolumeFactor,
UploadVolumeFactor = torrent.UploadVolumeFactor, UploadVolumeFactor = torrent.UploadVolumeFactor,
}).ToArray(); }).ToArray();

Loading…
Cancel
Save