mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-22 14:33:30 -07:00
Fixed import new series being stuck in a loop if an update failed
Seperated IndexerProviderTest from ProviderTests Fixed some ToString() issues Refactored IndexerBase/IndexerProvider
This commit is contained in:
parent
474f17c5e6
commit
a6ad977114
18 changed files with 403 additions and 306 deletions
|
@ -6,7 +6,6 @@ using System.Web;
|
|||
using NLog;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Repository;
|
||||
|
||||
namespace NzbDrone.Core.Providers.Indexer
|
||||
{
|
||||
|
@ -35,6 +34,15 @@ namespace NzbDrone.Core.Providers.Indexer
|
|||
protected abstract string[] Urls { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the credential.
|
||||
/// </summary>
|
||||
protected virtual NetworkCredential Credentials
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the rss url for specific episode search
|
||||
/// </summary>
|
||||
|
@ -45,13 +53,22 @@ namespace NzbDrone.Core.Providers.Indexer
|
|||
protected abstract IList<String> GetSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the credential.
|
||||
/// This method can be overwritten to provide indexer specific info parsing
|
||||
/// </summary>
|
||||
protected virtual NetworkCredential Credentials
|
||||
/// <param name="item">RSS item that needs to be parsed</param>
|
||||
/// <param name="currentResult">Result of the built in parse function.</param>
|
||||
/// <returns></returns>
|
||||
protected virtual EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
||||
{
|
||||
get { return null; }
|
||||
return currentResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates direct link to download an NZB
|
||||
/// </summary>
|
||||
/// <param name = "item">RSS Feed item to generate the link for</param>
|
||||
/// <returns>Download link URL</returns>
|
||||
protected abstract string NzbDownloadUrl(SyndicationItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Fetches RSS feed and process each news item.
|
||||
|
@ -90,7 +107,7 @@ namespace NzbDrone.Core.Providers.Indexer
|
|||
|
||||
}
|
||||
|
||||
private IList<EpisodeParseResult> Fetch(string url)
|
||||
private IEnumerable<EpisodeParseResult> Fetch(string url)
|
||||
{
|
||||
var result = new List<EpisodeParseResult>();
|
||||
|
||||
|
@ -140,23 +157,5 @@ namespace NzbDrone.Core.Providers.Indexer
|
|||
|
||||
return CustomParser(item, episodeParseResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method can be overwritten to provide indexer specific info parsing
|
||||
/// </summary>
|
||||
/// <param name="item">RSS item that needs to be parsed</param>
|
||||
/// <param name="currentResult">Result of the built in parse function.</param>
|
||||
/// <returns></returns>
|
||||
protected virtual EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
||||
{
|
||||
return currentResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates direct link to download an NZB
|
||||
/// </summary>
|
||||
/// <param name = "item">RSS Feed item to generate the link for</param>
|
||||
/// <returns>Download link URL</returns>
|
||||
protected abstract string NzbDownloadUrl(SyndicationItem item);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue