1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

Added Supports backlog boolean for Indexers.

This commit is contained in:
Mark McDowall 2011-05-01 01:04:44 -07:00
parent 00aa3ec7bc
commit 0e429f58a1
8 changed files with 52 additions and 3 deletions

View File

@ -177,6 +177,10 @@ public override string Name
get { return "Mocked Indexer"; } get { return "Mocked Indexer"; }
} }
public override bool SupportsBacklog
{
get { return false; }
}
protected override string NzbDownloadUrl(SyndicationItem item) protected override string NzbDownloadUrl(SyndicationItem item)
{ {
@ -201,6 +205,11 @@ public override string Name
get { return "All Urls"; } get { return "All Urls"; }
} }
public override bool SupportsBacklog
{
get { return false; }
}
protected override string[] Urls protected override string[] Urls
{ {
get { return new[] { "http://rss.nzbmatrix.com/rss.php?cat=TV" }; } get { return new[] { "http://rss.nzbmatrix.com/rss.php?cat=TV" }; }
@ -229,6 +238,11 @@ public override string Name
get { return "Custom parser"; } get { return "Custom parser"; }
} }
public override bool SupportsBacklog
{
get { return false; }
}
protected override string[] Urls protected override string[] Urls
{ {
get { return new[] { "http://www.google.com" }; } get { return new[] { "http://www.google.com" }; }

View File

@ -67,6 +67,13 @@ public virtual IList<Episode> GetEpisodeByParseResult(EpisodeParseResult parseRe
} }
public virtual IList<Episode> EpisodesWithoutFiles(bool includeSpecials)
{
if (includeSpecials)
return _repository.All<Episode>().Where(e => e.EpisodeFileId == 0 && e.AirDate <= DateTime.Today).ToList();
return _repository.All<Episode>().Where(e => e.EpisodeFileId == 0 && e.AirDate <= DateTime.Today && e.SeasonNumber > 0).ToList();
}
/// <summary> /// <summary>
/// Comprehensive check on whether or not this episode is needed. /// Comprehensive check on whether or not this episode is needed.
@ -87,6 +94,7 @@ public virtual bool IsNeeded(EpisodeParseResult parsedReport)
//Todo: How do we want to handle this really? Episode could be released before information is on TheTvDB //Todo: How do we want to handle this really? Episode could be released before information is on TheTvDB
//(Parks and Rec did this a lot in the first season, from experience) //(Parks and Rec did this a lot in the first season, from experience)
//Keivan: Should automatically add the episode to db with minimal information. then update the description/title when available. //Keivan: Should automatically add the episode to db with minimal information. then update the description/title when available.
//Mark: Perhaps we should only add the epsiode if its the latest season, sometimes people name things completely wrong (duh!)
episodeInfo = new Episode episodeInfo = new Episode
{ {
SeriesId = parsedReport.SeriesId, SeriesId = parsedReport.SeriesId,

View File

@ -40,6 +40,8 @@ protected IndexerProviderBase(SeriesProvider seriesProvider, SeasonProvider seas
_indexerProvider = indexerProvider; _indexerProvider = indexerProvider;
_historyProvider = historyProvider; _historyProvider = historyProvider;
_sabProvider = sabProvider; _sabProvider = sabProvider;
//Todo: IEnumerable yields no results for some reason, yet yields results in other classes
_externalNotificationProvider = externalNotificationProvider; _externalNotificationProvider = externalNotificationProvider;
_logger = LogManager.GetLogger(GetType().ToString()); _logger = LogManager.GetLogger(GetType().ToString());
} }
@ -49,6 +51,11 @@ protected IndexerProviderBase(SeriesProvider seriesProvider, SeasonProvider seas
/// </summary> /// </summary>
public abstract string Name { get; } public abstract string Name { get; }
/// <summary>
/// Gets a bool to determine if Backlog Searching is Supported
/// </summary>
public abstract bool SupportsBacklog { get; }
/// <summary> /// <summary>
/// Gets the source URL for the feed /// Gets the source URL for the feed
/// </summary> /// </summary>

View File

@ -43,6 +43,10 @@ public override string Name
get { return "Newzbin"; } get { return "Newzbin"; }
} }
public override bool SupportsBacklog
{
get { return false; }
}
protected override string NzbDownloadUrl(SyndicationItem item) protected override string NzbDownloadUrl(SyndicationItem item)
{ {

View File

@ -28,7 +28,7 @@ protected override string[] Urls
return new[] return new[]
{ {
string.Format( string.Format(
"http://rss.nzbmatrix.com/rss.php?page=download&username={0}&apikey={1}&subcat=6,41&english=1&scenename=1", "http://rss.nzbmatrix.com/rss.php?page=download&username={0}&apikey={1}&subcat=6,41&english=1&scenename=1&num=50",
_configProvider.NzbMatrixUsername, _configProvider.NzbMatrixUsername,
_configProvider.NzbMatrixApiKey) _configProvider.NzbMatrixApiKey)
}; };
@ -40,6 +40,11 @@ public override string Name
get { return "NzbMatrix"; } get { return "NzbMatrix"; }
} }
public override bool SupportsBacklog
{
get { return true; }
}
protected override string NzbDownloadUrl(SyndicationItem item) protected override string NzbDownloadUrl(SyndicationItem item)
{ {
return item.Links[0].Uri.ToString(); return item.Links[0].Uri.ToString();

View File

@ -36,6 +36,11 @@ public override string Name
get { return "Nzbs.org"; } get { return "Nzbs.org"; }
} }
public override bool SupportsBacklog
{
get { return false; }
}
protected override string NzbDownloadUrl(SyndicationItem item) protected override string NzbDownloadUrl(SyndicationItem item)
{ {
return item.Id; return item.Id;

View File

@ -34,12 +34,16 @@ protected override string[] Urls
} }
} }
public override string Name public override string Name
{ {
get { return "NzbsRUs"; } get { return "NzbsRUs"; }
} }
public override bool SupportsBacklog
{
get { return false; }
}
protected override string NzbDownloadUrl(SyndicationItem item) protected override string NzbDownloadUrl(SyndicationItem item)
{ {
return item.Links[0].Uri.ToString(); return item.Links[0].Uri.ToString();

View File

@ -13,5 +13,7 @@ public class IndexerSetting
public String IndexProviderType { get; set; } public String IndexProviderType { get; set; }
public String Name { get; set; } public String Name { get; set; }
public Boolean SupportsBacklog { get; set; }
} }
} }