Added Supports backlog boolean for Indexers.

pull/4/head
Mark McDowall 14 years ago
parent 00aa3ec7bc
commit 0e429f58a1

@ -177,6 +177,10 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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" }; }

@ -67,6 +67,13 @@ namespace NzbDrone.Core.Providers
} }
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 @@ namespace NzbDrone.Core.Providers
//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,

@ -40,6 +40,8 @@ namespace NzbDrone.Core.Providers.Indexer
_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 @@ namespace NzbDrone.Core.Providers.Indexer
/// </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>

@ -43,6 +43,10 @@ namespace NzbDrone.Core.Providers.Indexer
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)
{ {

@ -28,7 +28,7 @@ namespace NzbDrone.Core.Providers.Indexer
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 @@ namespace NzbDrone.Core.Providers.Indexer
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();

@ -36,6 +36,11 @@ namespace NzbDrone.Core.Providers.Indexer
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;

@ -33,13 +33,17 @@ namespace NzbDrone.Core.Providers.Indexer
}; };
} }
} }
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();

@ -13,5 +13,7 @@ namespace NzbDrone.Core.Repository
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; }
} }
} }
Loading…
Cancel
Save