mirror of
https://github.com/Jackett/Jackett
synced 2025-02-23 14:51:01 +00:00
Indexer ID rather than class name
This commit is contained in:
parent
c39feb7997
commit
195ec0a94c
5 changed files with 12 additions and 3 deletions
|
@ -99,7 +99,7 @@ namespace Jackett.Controllers
|
|||
foreach (var indexer in indexerService.GetAllIndexers())
|
||||
{
|
||||
var item = new JObject();
|
||||
item["id"] = indexer.GetType().Name;
|
||||
item["id"] = indexer.ID;
|
||||
item["name"] = indexer.DisplayName;
|
||||
item["description"] = indexer.DisplayDescription;
|
||||
item["configured"] = indexer.IsConfigured;
|
||||
|
|
|
@ -7,6 +7,7 @@ using Jackett.Models;
|
|||
using Newtonsoft.Json.Linq;
|
||||
using NLog;
|
||||
using Jackett.Services;
|
||||
using Jackett.Utils;
|
||||
|
||||
namespace Jackett.Indexers
|
||||
{
|
||||
|
@ -14,6 +15,7 @@ namespace Jackett.Indexers
|
|||
{
|
||||
public string DisplayDescription { 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 Uri SiteLink { get; private set; }
|
||||
public bool RequiresRageIDLookupDisabled { get; private set; }
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace Jackett.Indexers
|
|||
{
|
||||
string DisplayName { get; }
|
||||
string DisplayDescription { get; }
|
||||
string ID { get; }
|
||||
|
||||
Uri SiteLink { get; }
|
||||
|
||||
bool RequiresRageIDLookupDisabled { get; }
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Jackett.Services
|
|||
{
|
||||
foreach (var idx in container.Resolve<IEnumerable<IIndexer>>().OrderBy(_ => _.DisplayName))
|
||||
{
|
||||
indexers.Add(idx.DisplayName, idx);
|
||||
indexers.Add(idx.ID, idx);
|
||||
var configFilePath = GetIndexerConfigFilePath(idx);
|
||||
if (File.Exists(configFilePath))
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ namespace Jackett.Services
|
|||
|
||||
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)
|
||||
|
|
|
@ -16,5 +16,10 @@ namespace Jackett.Utils
|
|||
return str;
|
||||
}
|
||||
|
||||
public static string FromBase64(string str)
|
||||
{
|
||||
return Encoding.UTF8.GetString(Convert.FromBase64String(str));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue