1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

remove query selection logic and rename param to tvRageId

This commit is contained in:
faush01 2013-08-06 17:38:16 +10:00
parent f29eb49c7f
commit 9f4dfa16d1
7 changed files with 28 additions and 59 deletions

View File

@ -17,9 +17,9 @@ public interface IIndexer
IParseFeed Parser { get; } IParseFeed Parser { get; }
IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber); IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber);
IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date); IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date);
IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber); IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber);
IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard); IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard);
} }
} }

View File

@ -34,10 +34,10 @@ public virtual IParseFeed Parser
} }
public abstract IEnumerable<string> RecentFeed { get; } public abstract IEnumerable<string> RecentFeed { get; }
public abstract IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber); public abstract IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber);
public abstract IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date); public abstract IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date);
public abstract IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber); public abstract IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber);
public abstract IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard); public abstract IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard);
} }

View File

@ -84,52 +84,24 @@ public override IEnumerable<string> RecentFeed
} }
} }
public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber)
{ {
if (Settings.UseRageTvId) return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&ep={3}", url, tvRageId, seasonNumber, episodeNumber));
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&ep={3}", url, rageTvId, seasonNumber, episodeNumber));
}
else
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}&ep={3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeNumber));
}
} }
public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date)
{ {
if (Settings.UseRageTvId) return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, tvRageId, date)).ToList();
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, rageTvId, date)).ToList();
}
else
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2:yyyy}&ep={2:MM/dd}", url, NewsnabifyTitle(seriesTitle), date)).ToList();
}
} }
public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber)
{ {
if (Settings.UseRageTvId) return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}", url, tvRageId, seasonNumber));
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}", url, rageTvId, seasonNumber));
}
else
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2}", url, NewsnabifyTitle(seriesTitle), seasonNumber));
}
} }
public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard)
{ {
if (Settings.UseRageTvId) return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&q=E{3}", url, tvRageId, seasonNumber, episodeWildcard));
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2}&q=E{3}", url, rageTvId, seasonNumber, episodeWildcard));
}
else
{
return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}+S{2:00}E{3}", url, NewsnabifyTitle(seriesTitle), seasonNumber, episodeWildcard));
}
} }
public override string Name public override string Name

View File

@ -10,7 +10,6 @@ public class NewznabSettings : IIndexerSetting
public NewznabSettings() public NewznabSettings()
{ {
Categories = new [] { 5030, 5040 }; Categories = new [] { 5030, 5040 };
UseRageTvId = true;
} }
[FieldDefinition(0, Label = "URL")] [FieldDefinition(0, Label = "URL")]
@ -21,8 +20,6 @@ public NewznabSettings()
public IEnumerable<Int32> Categories { get; set; } public IEnumerable<Int32> Categories { get; set; }
public bool UseRageTvId { get; set; }
public bool IsValid public bool IsValid
{ {
get get

View File

@ -35,7 +35,7 @@ public override IEnumerable<string> RecentFeed
} }
} }
public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber)
{ {
var searchUrls = new List<string>(); var searchUrls = new List<string>();
@ -47,7 +47,7 @@ public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int
return searchUrls; return searchUrls;
} }
public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber)
{ {
var searchUrls = new List<string>(); var searchUrls = new List<string>();
@ -59,7 +59,7 @@ public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int
return searchUrls; return searchUrls;
} }
public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date)
{ {
var searchUrls = new List<String>(); var searchUrls = new List<String>();
@ -71,7 +71,7 @@ public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle
return searchUrls; return searchUrls;
} }
public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard)
{ {
var searchUrls = new List<String>(); var searchUrls = new List<String>();

View File

@ -20,7 +20,7 @@ public override IEnumerable<string> RecentFeed
} }
} }
public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber)
{ {
var searchUrls = new List<string>(); var searchUrls = new List<string>();
@ -32,7 +32,7 @@ public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int
return searchUrls; return searchUrls;
} }
public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date)
{ {
var searchUrls = new List<String>(); var searchUrls = new List<String>();
@ -44,7 +44,7 @@ public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle
return searchUrls; return searchUrls;
} }
public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber)
{ {
var searchUrls = new List<String>(); var searchUrls = new List<String>();
@ -56,7 +56,7 @@ public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int
return searchUrls; return searchUrls;
} }
public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard)
{ {
var searchUrls = new List<String>(); var searchUrls = new List<String>();

View File

@ -23,22 +23,22 @@ public override IEnumerable<string> RecentFeed
get { yield return "http://nzb.isasecret.com/rss/?sec=TV&fr=false"; } get { yield return "http://nzb.isasecret.com/rss/?sec=TV&fr=false"; }
} }
public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeNumber) public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber)
{ {
return new List<string>(); return new List<string>();
} }
public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber) public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber)
{ {
return new List<string>(); return new List<string>();
} }
public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int rageTvId, DateTime date) public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date)
{ {
return new List<string>(); return new List<string>();
} }
public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int rageTvId, int seasonNumber, int episodeWildcard) public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeWildcard)
{ {
return new List<string>(); return new List<string>();
} }