mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Fixed: (RetroFlix) Set 5 days as MST, return 100 results and remove "[REQUESTED]" from title
This commit is contained in:
parent
f386ddb806
commit
c60a94adfb
2 changed files with 15 additions and 7 deletions
|
|
@ -14,6 +14,7 @@ public class RetroFlix : SpeedAppBase
|
|||
public override string Description => "Private Torrent Tracker for Classic Movies / TV / General Releases";
|
||||
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
||||
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)
|
||||
: base(httpClient, eventAggregator, indexerStatusService, configService, logger, indexerRepository)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
using System.Net.Http;
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using FluentValidation;
|
||||
using Newtonsoft.Json;
|
||||
|
|
@ -21,7 +22,6 @@
|
|||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions
|
||||
|
|
@ -32,7 +32,7 @@ public abstract class SpeedAppBase : TorrentIndexerBase<SpeedAppSettings>
|
|||
public override Encoding Encoding => Encoding.UTF8;
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||
public override IndexerCapabilities Capabilities => SetCapabilities();
|
||||
|
||||
protected virtual int MinimumSeedTime => 172800; // 48 hours
|
||||
private IIndexerRepository _indexerRepository;
|
||||
|
||||
public SpeedAppBase(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger, IIndexerRepository indexerRepository)
|
||||
|
|
@ -48,7 +48,7 @@ public override IIndexerRequestGenerator GetRequestGenerator()
|
|||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
{
|
||||
return new SpeedAppParser(Settings, Capabilities.Categories);
|
||||
return new SpeedAppParser(Settings, Capabilities.Categories, MinimumSeedTime);
|
||||
}
|
||||
|
||||
protected override bool CheckIfLoginNeeded(HttpResponse httpResponse)
|
||||
|
|
@ -226,7 +226,12 @@ private IndexerPageableRequestChain GetSearch(SearchCriteriaBase searchCriteria,
|
|||
|
||||
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())
|
||||
{
|
||||
|
|
@ -271,13 +276,15 @@ public class SpeedAppParser : IParseIndexerResponse
|
|||
{
|
||||
private readonly SpeedAppSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
private readonly int _minimumSeedTime;
|
||||
|
||||
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;
|
||||
_categories = categories;
|
||||
_minimumSeedTime = minimumSeedTime;
|
||||
}
|
||||
|
||||
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
||||
|
|
@ -297,7 +304,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
return jsonResponse.Resource.Select(torrent => new TorrentInfo
|
||||
{
|
||||
Guid = torrent.Id.ToString(),
|
||||
Title = torrent.Name,
|
||||
Title = Regex.Replace(torrent.Name, @"(?i:\[REQUESTED\])", "").Trim(' ', '.'),
|
||||
Description = torrent.ShortDescription,
|
||||
Size = torrent.Size,
|
||||
ImdbId = ParseUtil.GetImdbID(torrent.ImdbId).GetValueOrDefault(),
|
||||
|
|
@ -311,7 +318,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
Seeders = torrent.Seeders,
|
||||
Peers = torrent.Leechers + torrent.Seeders,
|
||||
MinimumRatio = 1,
|
||||
MinimumSeedTime = 172800,
|
||||
MinimumSeedTime = _minimumSeedTime,
|
||||
DownloadVolumeFactor = torrent.DownloadVolumeFactor,
|
||||
UploadVolumeFactor = torrent.UploadVolumeFactor,
|
||||
}).ToArray();
|
||||
|
|
|
|||
Loading…
Reference in a new issue