mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-31 20:15:55 +00:00
Newznab Indexer should not cause everything to fail and we should get exceptions.
This commit is contained in:
parent
3468adf85c
commit
9ae7731aa3
1 changed files with 39 additions and 21 deletions
|
@ -70,13 +70,21 @@ public virtual void InitializeNewznabIndexers(IList<NewznabDefinition> indexers)
|
||||||
{
|
{
|
||||||
Logger.Debug("Initializing Newznab indexers. Count {0}", indexers.Count);
|
Logger.Debug("Initializing Newznab indexers. Count {0}", indexers.Count);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
var currentIndexers = All();
|
var currentIndexers = All();
|
||||||
|
|
||||||
foreach (var feedProvider in indexers)
|
foreach(var feedProvider in indexers)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
NewznabDefinition indexerLocal = feedProvider;
|
NewznabDefinition indexerLocal = feedProvider;
|
||||||
var currentIndexer = currentIndexers
|
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)
|
if (currentIndexer == null)
|
||||||
{
|
{
|
||||||
|
@ -98,6 +106,16 @@ public virtual void InitializeNewznabIndexers(IList<NewznabDefinition> indexers)
|
||||||
Save(currentIndexer);
|
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)
|
public virtual void Delete(int id)
|
||||||
|
|
Loading…
Reference in a new issue