|
|
|
@ -4,7 +4,6 @@ using System.ServiceModel.Syndication;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using Ninject;
|
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
using NzbDrone.Core.Model.Search;
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
@ -12,7 +11,8 @@ namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
|
public class NzbMatrix : IndexerBase
|
|
|
|
|
{
|
|
|
|
|
[Inject]
|
|
|
|
|
public NzbMatrix(HttpProvider httpProvider, ConfigProvider configProvider) : base(httpProvider, configProvider)
|
|
|
|
|
public NzbMatrix(HttpProvider httpProvider, ConfigProvider configProvider)
|
|
|
|
|
: base(httpProvider, configProvider)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -30,51 +30,66 @@ namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
|
|
|
|
{
|
|
|
|
|
get { return "NzbMatrix"; }
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+s{2:00}e{3:00}", url, seriesTitle, seasonNumber, episodeNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string NzbDownloadUrl(SyndicationItem item)
|
|
|
|
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
|
|
|
|
{
|
|
|
|
|
return item.Links[0].Uri.ToString();
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+{2:yyyy MM dd}", url, seriesTitle, date));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
|
|
|
|
{
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
if (searchModel.SearchType == SearchType.EpisodeSearch)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+s{2:00}e{3:00}", url, searchModel.SeriesTitle,
|
|
|
|
|
searchModel.SeasonNumber, searchModel.EpisodeNumber));
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+Season", url, seriesTitle));
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}", url, seriesTitle, seasonNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.PartialSeasonSearch)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}E{3}",
|
|
|
|
|
url, searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodePrefix));
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.SeasonSearch)
|
|
|
|
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+Season", url, searchModel.SeriesTitle));
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}", url, searchModel.SeriesTitle, searchModel.SeasonNumber));
|
|
|
|
|
}
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.DailySearch)
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+{2:yyyy MM dd}", url, searchModel.SeriesTitle,
|
|
|
|
|
searchModel.AirDate));
|
|
|
|
|
}
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "NzbMatrix"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override string NzbDownloadUrl(SyndicationItem item)
|
|
|
|
|
{
|
|
|
|
|
return item.Links[0].Uri.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
|
|
|
|
{
|
|
|
|
|
if (currentResult != null)
|
|
|
|
|