|
|
|
@ -70,13 +70,21 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
{
|
|
|
|
|
Logger.Debug("Initializing Newznab indexers. Count {0}", indexers.Count);
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var currentIndexers = All();
|
|
|
|
|
|
|
|
|
|
foreach(var feedProvider in indexers)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NewznabDefinition indexerLocal = feedProvider;
|
|
|
|
|
var currentIndexer = currentIndexers
|
|
|
|
|
.FirstOrDefault(c => new Uri(c.Url.ToLower()).Host == new Uri(indexerLocal.Url.ToLower()).Host);
|
|
|
|
|
.FirstOrDefault(
|
|
|
|
|
c =>
|
|
|
|
|
new Uri(c.Url.ToLower()).Host == new Uri(indexerLocal.Url.ToLower()).Host);
|
|
|
|
|
|
|
|
|
|
if (currentIndexer == null)
|
|
|
|
|
{
|
|
|
|
@ -98,6 +106,16 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
Save(currentIndexer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Logger.ErrorException("An error occurred while setting up indexer: " + feedProvider.Name, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Logger.ErrorException("An Error occurred while initializing Newznab Indexers", ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void Delete(int id)
|
|
|
|
|