mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Indexer ID rather than class name
This commit is contained in:
@@ -99,7 +99,7 @@ namespace Jackett.Controllers
|
|||||||
foreach (var indexer in indexerService.GetAllIndexers())
|
foreach (var indexer in indexerService.GetAllIndexers())
|
||||||
{
|
{
|
||||||
var item = new JObject();
|
var item = new JObject();
|
||||||
item["id"] = indexer.GetType().Name;
|
item["id"] = indexer.ID;
|
||||||
item["name"] = indexer.DisplayName;
|
item["name"] = indexer.DisplayName;
|
||||||
item["description"] = indexer.DisplayDescription;
|
item["description"] = indexer.DisplayDescription;
|
||||||
item["configured"] = indexer.IsConfigured;
|
item["configured"] = indexer.IsConfigured;
|
||||||
|
@@ -7,6 +7,7 @@ using Jackett.Models;
|
|||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Jackett.Services;
|
using Jackett.Services;
|
||||||
|
using Jackett.Utils;
|
||||||
|
|
||||||
namespace Jackett.Indexers
|
namespace Jackett.Indexers
|
||||||
{
|
{
|
||||||
@@ -14,6 +15,7 @@ namespace Jackett.Indexers
|
|||||||
{
|
{
|
||||||
public string DisplayDescription { get; private set; }
|
public string DisplayDescription { get; private set; }
|
||||||
public string DisplayName { get; private set; }
|
public string DisplayName { get; private set; }
|
||||||
|
public string ID { get { return StringUtil.StripNonAlphaNumeric(GetType().Name.ToLowerInvariant()); } }
|
||||||
public bool IsConfigured { get; protected set; }
|
public bool IsConfigured { get; protected set; }
|
||||||
public Uri SiteLink { get; private set; }
|
public Uri SiteLink { get; private set; }
|
||||||
public bool RequiresRageIDLookupDisabled { get; private set; }
|
public bool RequiresRageIDLookupDisabled { get; private set; }
|
||||||
|
@@ -13,6 +13,8 @@ namespace Jackett.Indexers
|
|||||||
{
|
{
|
||||||
string DisplayName { get; }
|
string DisplayName { get; }
|
||||||
string DisplayDescription { get; }
|
string DisplayDescription { get; }
|
||||||
|
string ID { get; }
|
||||||
|
|
||||||
Uri SiteLink { get; }
|
Uri SiteLink { get; }
|
||||||
|
|
||||||
bool RequiresRageIDLookupDisabled { get; }
|
bool RequiresRageIDLookupDisabled { get; }
|
||||||
|
@@ -41,7 +41,7 @@ namespace Jackett.Services
|
|||||||
{
|
{
|
||||||
foreach (var idx in container.Resolve<IEnumerable<IIndexer>>().OrderBy(_ => _.DisplayName))
|
foreach (var idx in container.Resolve<IEnumerable<IIndexer>>().OrderBy(_ => _.DisplayName))
|
||||||
{
|
{
|
||||||
indexers.Add(idx.DisplayName, idx);
|
indexers.Add(idx.ID, idx);
|
||||||
var configFilePath = GetIndexerConfigFilePath(idx);
|
var configFilePath = GetIndexerConfigFilePath(idx);
|
||||||
if (File.Exists(configFilePath))
|
if (File.Exists(configFilePath))
|
||||||
{
|
{
|
||||||
@@ -90,7 +90,7 @@ namespace Jackett.Services
|
|||||||
|
|
||||||
private string GetIndexerConfigFilePath(IIndexer indexer)
|
private string GetIndexerConfigFilePath(IIndexer indexer)
|
||||||
{
|
{
|
||||||
return Path.Combine(configService.GetIndexerConfigDir(), indexer.GetType().Name.ToLower() + ".json");
|
return Path.Combine(configService.GetIndexerConfigDir(), indexer.ID + ".json");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveConfig(IIndexer indexer, JToken obj)
|
public void SaveConfig(IIndexer indexer, JToken obj)
|
||||||
|
@@ -16,5 +16,10 @@ namespace Jackett.Utils
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string FromBase64(string str)
|
||||||
|
{
|
||||||
|
return Encoding.UTF8.GetString(Convert.FromBase64String(str));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user