1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +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"; }
}
public override bool SupportsBacklog
{
get { return false; }
}
protected override string NzbDownloadUrl(SyndicationItem item)
{
@ -201,6 +205,11 @@ public override string Name
get { return "All Urls"; }
}
public override bool SupportsBacklog
{
get { return false; }
}
protected override string[] Urls
{
get { return new[] { "http://rss.nzbmatrix.com/rss.php?cat=TV" }; }
@ -229,6 +238,11 @@ public override string Name
get { return "Custom parser"; }
}
public override bool SupportsBacklog
{
get { return false; }
}
protected override string[] Urls
{
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>
/// 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
//(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.
//Mark: Perhaps we should only add the epsiode if its the latest season, sometimes people name things completely wrong (duh!)
episodeInfo = new Episode
{
SeriesId = parsedReport.SeriesId,

View File

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

View File

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

View File

@ -28,7 +28,7 @@ protected override string[] Urls
return new[]
{
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.NzbMatrixApiKey)
};
@ -40,6 +40,11 @@ public override string Name
get { return "NzbMatrix"; }
}
public override bool SupportsBacklog
{
get { return true; }
}
protected override string NzbDownloadUrl(SyndicationItem item)
{
return item.Links[0].Uri.ToString();

View File

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

View File

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

View File

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