mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-30 23:45:46 +02:00
Add Encoding, Language, Description Indexer props
This commit is contained in:
@@ -41,6 +41,9 @@ namespace NzbDrone.Core.Datastore
|
||||
|
||||
Mapper.Entity<IndexerDefinition>("Indexers").RegisterModel()
|
||||
.Ignore(x => x.ImplementationName)
|
||||
.Ignore(i => i.Description)
|
||||
.Ignore(i => i.Language)
|
||||
.Ignore(i => i.Encoding)
|
||||
.Ignore(i => i.BaseUrl)
|
||||
.Ignore(i => i.Protocol)
|
||||
.Ignore(i => i.Privacy)
|
||||
|
@@ -128,6 +128,11 @@ namespace NzbDrone.Core.IndexerVersions
|
||||
};
|
||||
}
|
||||
|
||||
if (definition.Encoding == null)
|
||||
{
|
||||
definition.Encoding = "UTF-8";
|
||||
}
|
||||
|
||||
if (definition.Login != null && definition.Login.Method == null)
|
||||
{
|
||||
definition.Login.Method = "form";
|
||||
|
@@ -10,6 +10,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
{
|
||||
public override string Name => "AlphaRatio";
|
||||
public override string BaseUrl => "https://alpharatio.cc/";
|
||||
public override string Description => "AlphaRatio(AR) is a Private Torrent Tracker for 0DAY / GENERAL";
|
||||
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
||||
|
||||
public AlphaRatio(IHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger)
|
||||
|
@@ -33,6 +33,12 @@ namespace NzbDrone.Core.Indexers
|
||||
public override bool SupportsSearch => true;
|
||||
public override bool SupportsRedirect => false;
|
||||
|
||||
public override Encoding Encoding => Encoding.UTF8;
|
||||
public override string Language => "en-US";
|
||||
|
||||
//TODO Remove this once we catch up on individual indexers
|
||||
public override string Description => "";
|
||||
|
||||
public override bool FollowRedirect => false;
|
||||
public override IndexerCapabilities Capabilities { get; protected set; }
|
||||
public virtual int PageSize => 0;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
@@ -13,6 +14,9 @@ namespace NzbDrone.Core.Indexers
|
||||
IndexerCapabilities Capabilities { get; }
|
||||
|
||||
string BaseUrl { get; }
|
||||
string Description { get; }
|
||||
Encoding Encoding { get; }
|
||||
string Language { get; }
|
||||
DownloadProtocol Protocol { get; }
|
||||
IndexerPrivacy Privacy { get; }
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FluentValidation.Results;
|
||||
using NLog;
|
||||
@@ -21,6 +22,9 @@ namespace NzbDrone.Core.Indexers
|
||||
|
||||
public abstract string Name { get; }
|
||||
public abstract string BaseUrl { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract Encoding Encoding { get; }
|
||||
public abstract string Language { get; }
|
||||
public abstract bool FollowRedirect { get; }
|
||||
public abstract DownloadProtocol Protocol { get; }
|
||||
public abstract IndexerPrivacy Privacy { get; }
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using NzbDrone.Core.Indexers.Cardigann;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
|
||||
@@ -8,6 +9,9 @@ namespace NzbDrone.Core.Indexers
|
||||
public class IndexerDefinition : ProviderDefinition
|
||||
{
|
||||
public string BaseUrl { get; set; }
|
||||
public string Description { get; set; }
|
||||
public Encoding Encoding { get; set; }
|
||||
public string Language { get; set; }
|
||||
public DownloadProtocol Protocol { get; set; }
|
||||
public IndexerPrivacy Privacy { get; set; }
|
||||
public bool SupportsRss { get; set; }
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using FluentValidation.Results;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Indexers.Cardigann;
|
||||
@@ -90,6 +91,9 @@ namespace NzbDrone.Core.Indexers
|
||||
}
|
||||
|
||||
definition.BaseUrl = defFile.Links.First();
|
||||
definition.Description = defFile.Description;
|
||||
definition.Language = defFile.Language;
|
||||
definition.Encoding = Encoding.GetEncoding(defFile.Encoding);
|
||||
definition.Privacy = defFile.Type == "private" ? IndexerPrivacy.Private : IndexerPrivacy.Public;
|
||||
definition.Capabilities = new IndexerCapabilities();
|
||||
definition.Capabilities.ParseCardigannSearchModes(defFile.Caps.Modes);
|
||||
@@ -172,6 +176,9 @@ namespace NzbDrone.Core.Indexers
|
||||
{
|
||||
definition.BaseUrl = provider.BaseUrl;
|
||||
definition.Privacy = provider.Privacy;
|
||||
definition.Description = provider.Description;
|
||||
definition.Encoding = provider.Encoding;
|
||||
definition.Language = provider.Language;
|
||||
definition.Capabilities = provider.Capabilities;
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Indexers;
|
||||
@@ -13,6 +14,9 @@ namespace Prowlarr.Api.V1.Indexers
|
||||
public class IndexerResource : ProviderResource<IndexerResource>
|
||||
{
|
||||
public string BaseUrl { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string Encoding { get; set; }
|
||||
public bool Enable { get; set; }
|
||||
public bool Redirect { get; set; }
|
||||
public bool SupportsRss { get; set; }
|
||||
@@ -62,6 +66,9 @@ namespace Prowlarr.Api.V1.Indexers
|
||||
}
|
||||
|
||||
resource.BaseUrl = definition.BaseUrl;
|
||||
resource.Description = definition.Description;
|
||||
resource.Language = definition.Language;
|
||||
resource.Encoding = definition.Encoding.EncodingName;
|
||||
resource.Enable = definition.Enable;
|
||||
resource.Redirect = definition.Redirect;
|
||||
resource.SupportsRss = definition.SupportsRss;
|
||||
|
Reference in New Issue
Block a user