mirror of https://github.com/Jackett/Jackett
Upgrade fix and testing an indexer now adds to the cache
This commit is contained in:
parent
ea069810a5
commit
d3e43b290f
|
@ -141,7 +141,20 @@ namespace Jackett.Indexers
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Legacy cookie key
|
// Legacy cookie key
|
||||||
cookieHeader = (string)jsonConfig["cookies"];
|
var jcookes = jsonConfig["cookies"];
|
||||||
|
if (jcookes is JArray) {
|
||||||
|
var array = (JArray)jsonConfig["cookies"];
|
||||||
|
cookieHeader = string.Empty;
|
||||||
|
for (int i = 0; i < array.Count; i++)
|
||||||
|
{
|
||||||
|
if (i != 0)
|
||||||
|
cookieHeader += "; ";
|
||||||
|
cookieHeader += array[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cookieHeader = (string)jsonConfig["cookies"];
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(cookieHeader))
|
if (!string.IsNullOrEmpty(cookieHeader))
|
||||||
{
|
{
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
|
|
|
@ -30,12 +30,14 @@ namespace Jackett.Services
|
||||||
private IConfigurationService configService;
|
private IConfigurationService configService;
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
private Dictionary<string, IIndexer> indexers = new Dictionary<string, IIndexer>();
|
private Dictionary<string, IIndexer> indexers = new Dictionary<string, IIndexer>();
|
||||||
|
private ICacheService cacheService;
|
||||||
|
|
||||||
public IndexerManagerService(IContainer c, IConfigurationService config, Logger l)
|
public IndexerManagerService(IContainer c, IConfigurationService config, Logger l, ICacheService cache)
|
||||||
{
|
{
|
||||||
container = c;
|
container = c;
|
||||||
configService = config;
|
configService = config;
|
||||||
logger = l;
|
logger = l;
|
||||||
|
cacheService = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitIndexers()
|
public void InitIndexers()
|
||||||
|
@ -80,6 +82,7 @@ namespace Jackett.Services
|
||||||
logger.Info(string.Format("Found {0} releases from {1}", results.Count(), indexer.DisplayName));
|
logger.Info(string.Format("Found {0} releases from {1}", results.Count(), indexer.DisplayName));
|
||||||
if (results.Count() == 0)
|
if (results.Count() == 0)
|
||||||
throw new Exception("Found no results while trying to browse this tracker");
|
throw new Exception("Found no results while trying to browse this tracker");
|
||||||
|
cacheService.CacheRssResults(indexer.DisplayName, results);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteIndexer(string name)
|
public void DeleteIndexer(string name)
|
||||||
|
|
Loading…
Reference in New Issue