mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-10 23:29:53 +02:00
Merge branch 'kay.one' of github.com:NzbDrone/NzbDrone into markus
This commit is contained in:
commit
168f83dc38
@ -8,7 +8,6 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Providers;
|
using NzbDrone.Core.Providers;
|
||||||
using NzbDrone.Core.Providers.Core;
|
using NzbDrone.Core.Providers.Core;
|
||||||
using NzbDrone.Core.Providers.Indexer;
|
using NzbDrone.Core.Providers.Indexer;
|
||||||
@ -76,14 +75,29 @@ protected override string[] Urls
|
|||||||
get { return new[] { "www.google.com" }; }
|
get { return new[] { "www.google.com" }; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
protected override NetworkCredential Credentials
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override NetworkCredential Credentials
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
{
|
{
|
||||||
get { return null; }
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Name
|
public override string Name
|
||||||
@ -115,7 +129,22 @@ 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" }; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@ -143,7 +172,22 @@ protected override string[] Urls
|
|||||||
get { return new[] { "http://www.google.com" }; }
|
get { return new[] { "http://www.google.com" }; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Model.Search
|
|
||||||
{
|
|
||||||
public class SearchModel
|
|
||||||
{
|
|
||||||
public string SeriesTitle { get; set; }
|
|
||||||
public int EpisodeNumber { get; set; }
|
|
||||||
public int SeasonNumber { get; set; }
|
|
||||||
public int EpisodePrefix { get; set; }
|
|
||||||
public DateTime AirDate { get; set; }
|
|
||||||
public SearchType SearchType { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Model.Search
|
|
||||||
{
|
|
||||||
public enum SearchType
|
|
||||||
{
|
|
||||||
EpisodeSearch = 0,
|
|
||||||
DailySearch = 1,
|
|
||||||
PartialSeasonSearch = 2,
|
|
||||||
SeasonSearch = 3
|
|
||||||
}
|
|
||||||
}
|
|
@ -230,8 +230,6 @@
|
|||||||
<Compile Include="Model\Quality.cs" />
|
<Compile Include="Model\Quality.cs" />
|
||||||
<Compile Include="Model\SabnzbdCategoryModel.cs" />
|
<Compile Include="Model\SabnzbdCategoryModel.cs" />
|
||||||
<Compile Include="Model\SabnzbdInfoModel.cs" />
|
<Compile Include="Model\SabnzbdInfoModel.cs" />
|
||||||
<Compile Include="Model\Search\SearchModel.cs" />
|
|
||||||
<Compile Include="Model\Search\SearchType.cs" />
|
|
||||||
<Compile Include="Model\Twitter\TwitterAuthorizationModel.cs" />
|
<Compile Include="Model\Twitter\TwitterAuthorizationModel.cs" />
|
||||||
<Compile Include="Model\UpdatePackage.cs" />
|
<Compile Include="Model\UpdatePackage.cs" />
|
||||||
<Compile Include="Model\Xbmc\ActionType.cs" />
|
<Compile Include="Model\Xbmc\ActionType.cs" />
|
||||||
|
@ -161,6 +161,7 @@ public virtual IList<Episode> GetEpisodesByParseResult(EpisodeParseResult parseR
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Add to Result and Return (There will only be one episode to return)
|
//Add to Result and Return (There will only be one episode to return)
|
||||||
|
//TODO: This should not add if episode is still null (When doesn't exist and autoadd is false.)
|
||||||
result.Add(episodeInfo);
|
result.Add(episodeInfo);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,9 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.ServiceModel.Syndication;
|
using System.ServiceModel.Syndication;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Web;
|
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Providers.Core;
|
using NzbDrone.Core.Providers.Core;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Indexer
|
namespace NzbDrone.Core.Providers.Indexer
|
||||||
@ -55,12 +53,10 @@ protected virtual NetworkCredential Credentials
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
protected abstract IList<String> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber);
|
||||||
/// Gets the rss url for specific episode search
|
protected abstract IList<String> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date);
|
||||||
/// </summary>
|
protected abstract IList<String> GetSeasonSearchUrls(string seriesTitle, int seasonNumber);
|
||||||
/// <param name="searchModel">SearchModel containing episode information</param>
|
protected abstract IList<String> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard);
|
||||||
/// <returns></returns>
|
|
||||||
protected abstract IList<String> GetSearchUrls(SearchModel searchModel);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This method can be overwritten to provide indexer specific info parsing
|
/// This method can be overwritten to provide indexer specific info parsing
|
||||||
@ -104,14 +100,7 @@ public virtual IList<EpisodeParseResult> FetchSeason(string seriesTitle, int sea
|
|||||||
|
|
||||||
var result = new List<EpisodeParseResult>();
|
var result = new List<EpisodeParseResult>();
|
||||||
|
|
||||||
var searchModel = new SearchModel
|
var searchUrls = GetSeasonSearchUrls(GetQueryTitle(seriesTitle), seasonNumber);
|
||||||
{
|
|
||||||
SeriesTitle = GetQueryTitle(seriesTitle),
|
|
||||||
SeasonNumber = seasonNumber,
|
|
||||||
SearchType = SearchType.SeasonSearch
|
|
||||||
};
|
|
||||||
|
|
||||||
var searchUrls = GetSearchUrls(searchModel);
|
|
||||||
|
|
||||||
foreach (var url in searchUrls)
|
foreach (var url in searchUrls)
|
||||||
{
|
{
|
||||||
@ -130,15 +119,7 @@ public virtual IList<EpisodeParseResult> FetchPartialSeason(string seriesTitle,
|
|||||||
|
|
||||||
var result = new List<EpisodeParseResult>();
|
var result = new List<EpisodeParseResult>();
|
||||||
|
|
||||||
var searchModel = new SearchModel
|
var searchUrls = GetPartialSeasonSearchUrls(GetQueryTitle(seriesTitle), seasonNumber, episodePrefix);
|
||||||
{
|
|
||||||
SeriesTitle = GetQueryTitle(seriesTitle),
|
|
||||||
SeasonNumber = seasonNumber,
|
|
||||||
EpisodePrefix = episodePrefix,
|
|
||||||
SearchType = SearchType.PartialSeasonSearch
|
|
||||||
};
|
|
||||||
|
|
||||||
var searchUrls = GetSearchUrls(searchModel);
|
|
||||||
|
|
||||||
foreach (var url in searchUrls)
|
foreach (var url in searchUrls)
|
||||||
{
|
{
|
||||||
@ -157,15 +138,7 @@ public virtual IList<EpisodeParseResult> FetchEpisode(string seriesTitle, int se
|
|||||||
|
|
||||||
var result = new List<EpisodeParseResult>();
|
var result = new List<EpisodeParseResult>();
|
||||||
|
|
||||||
var searchModel = new SearchModel
|
var searchUrls = GetEpisodeSearchUrls(GetQueryTitle(seriesTitle), seasonNumber, episodeNumber);
|
||||||
{
|
|
||||||
SeriesTitle = GetQueryTitle(seriesTitle),
|
|
||||||
SeasonNumber = seasonNumber,
|
|
||||||
EpisodeNumber = episodeNumber,
|
|
||||||
SearchType = SearchType.EpisodeSearch
|
|
||||||
};
|
|
||||||
|
|
||||||
var searchUrls = GetSearchUrls(searchModel);
|
|
||||||
|
|
||||||
foreach (var url in searchUrls)
|
foreach (var url in searchUrls)
|
||||||
{
|
{
|
||||||
@ -185,14 +158,7 @@ public virtual IList<EpisodeParseResult> FetchDailyEpisode(string seriesTitle, D
|
|||||||
|
|
||||||
var result = new List<EpisodeParseResult>();
|
var result = new List<EpisodeParseResult>();
|
||||||
|
|
||||||
var searchModel = new SearchModel
|
var searchUrls = GetDailyEpisodeSearchUrls(GetQueryTitle(seriesTitle), airDate);
|
||||||
{
|
|
||||||
SeriesTitle = GetQueryTitle(seriesTitle),
|
|
||||||
AirDate = airDate,
|
|
||||||
SearchType = SearchType.DailySearch
|
|
||||||
};
|
|
||||||
|
|
||||||
var searchUrls = GetSearchUrls(searchModel);
|
|
||||||
|
|
||||||
foreach (var url in searchUrls)
|
foreach (var url in searchUrls)
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Providers.Core;
|
using NzbDrone.Core.Providers.Core;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Indexer
|
namespace NzbDrone.Core.Providers.Indexer
|
||||||
@ -18,7 +17,7 @@ public Newzbin(HttpProvider httpProvider, ConfigProvider configProvider)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string UrlParams = "feed=rss&hauth=1&ps_rb_language=4096";
|
private const string URL_PARAMS = "feed=rss&hauth=1&ps_rb_language=4096";
|
||||||
|
|
||||||
protected override string[] Urls
|
protected override string[] Urls
|
||||||
{
|
{
|
||||||
@ -26,7 +25,7 @@ protected override string[] Urls
|
|||||||
{
|
{
|
||||||
return new[]
|
return new[]
|
||||||
{
|
{
|
||||||
"http://www.newzbin.com/browse/category/p/tv?" + UrlParams
|
"http://www.newzbin.com/browse/category/p/tv?" + URL_PARAMS
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,52 +38,47 @@ protected override NetworkCredential Credentials
|
|||||||
get { return new NetworkCredential(_configProvider.NewzbinUsername, _configProvider.NewzbinPassword); }
|
get { return new NetworkCredential(_configProvider.NewzbinUsername, _configProvider.NewzbinPassword); }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
{
|
{
|
||||||
if (searchModel.SearchType == SearchType.EpisodeSearch)
|
return new List<string>
|
||||||
{
|
|
||||||
return new List<string>
|
|
||||||
{
|
{
|
||||||
String.Format(
|
String.Format(
|
||||||
@"http://www.newzbin.com/search/query/?q={0}+{1}x{2:00}&fpn=p&searchaction=Go&category=8&{3}",
|
@"http://www.newzbin.com/search/query/?q={0}+{1}x{2:00}&fpn=p&searchaction=Go&category=8&{3}",
|
||||||
searchModel.SeriesTitle, searchModel.SeasonNumber,
|
seriesTitle, seasonNumber,episodeNumber, URL_PARAMS)
|
||||||
searchModel.EpisodeNumber, UrlParams)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.SeasonSearch)
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
{
|
{
|
||||||
return new List<string>
|
return new List<string>
|
||||||
{
|
{
|
||||||
String.Format(
|
String.Format(
|
||||||
@"http://www.newzbin.com/search/query/?q={0}+Season+{1}&fpn=p&searchaction=Go&category=8&{2}",
|
@"http://www.newzbin.com/search/query/?q={0}+Season+{1}&fpn=p&searchaction=Go&category=8&{2}",
|
||||||
searchModel.SeriesTitle, searchModel.SeasonNumber, UrlParams)
|
seriesTitle, seasonNumber, URL_PARAMS)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.PartialSeasonSearch)
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
{
|
{
|
||||||
return new List<string>
|
return new List<string>
|
||||||
{
|
|
||||||
String.Format(
|
|
||||||
@"http://www.newzbin.com/search/query/?q={0}+{1}x{2}&fpn=p&searchaction=Go&category=8&{3}",
|
|
||||||
searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodePrefix, UrlParams)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.DailySearch)
|
|
||||||
{
|
|
||||||
return new List<string>
|
|
||||||
{
|
{
|
||||||
String.Format(
|
String.Format(
|
||||||
@"http://www.newzbin.com/search/query/?q={0}+{1:yyyy-MM-dd}&fpn=p&searchaction=Go&category=8&{2}",
|
@"http://www.newzbin.com/search/query/?q={0}+{1:yyyy-MM-dd}&fpn=p&searchaction=Go&category=8&{2}",
|
||||||
searchModel.SeriesTitle, searchModel.AirDate, UrlParams)
|
seriesTitle, date, URL_PARAMS)
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
return new List<string>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
|
{
|
||||||
|
return new List<string>
|
||||||
|
{
|
||||||
|
String.Format(
|
||||||
|
@"http://www.newzbin.com/search/query/?q={0}+{1}x{2}&fpn=p&searchaction=Go&category=8&{3}",
|
||||||
|
seriesTitle, seasonNumber, episodeWildcard, URL_PARAMS)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public override string Name
|
public override string Name
|
||||||
{
|
{
|
||||||
get { return "Newzbin"; }
|
get { return "Newzbin"; }
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Providers.Core;
|
using NzbDrone.Core.Providers.Core;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Indexer
|
namespace NzbDrone.Core.Providers.Indexer
|
||||||
@ -16,15 +15,49 @@ public class Newznab : IndexerBase
|
|||||||
[Inject]
|
[Inject]
|
||||||
public Newznab(HttpProvider httpProvider, ConfigProvider configProvider, NewznabProvider newznabProvider)
|
public Newznab(HttpProvider httpProvider, ConfigProvider configProvider, NewznabProvider newznabProvider)
|
||||||
: base(httpProvider, configProvider)
|
: base(httpProvider, configProvider)
|
||||||
{
|
{
|
||||||
_newznabProvider = newznabProvider;
|
_newznabProvider = newznabProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string[] Urls
|
protected override string[] Urls
|
||||||
{
|
{
|
||||||
get { return GetUrls(); }
|
get { return GetUrls(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<string>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&limit=100&q={1}&season{2}&ep{3}", url, seriesTitle, seasonNumber, episodeNumber));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<string>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&limit=100&q={1}+{2:yyyy MM dd}", url, seriesTitle, date));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
|
{
|
||||||
|
return new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
|
{
|
||||||
|
return new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
public override string Name
|
public override string Name
|
||||||
{
|
{
|
||||||
get { return "Newznab"; }
|
get { return "Newznab"; }
|
||||||
@ -35,33 +68,6 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
|||||||
return item.Id;
|
return item.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
|
||||||
{
|
|
||||||
var searchUrls = new List<String>();
|
|
||||||
|
|
||||||
foreach (var url in Urls)
|
|
||||||
{
|
|
||||||
if (searchModel.SearchType == SearchType.EpisodeSearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&limit=100&q={1}&season{2}&ep{3}", url,
|
|
||||||
searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodeNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.SeasonSearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&limit=100&q={1}&season={2}", url, searchModel.SeriesTitle, searchModel.SeasonNumber));
|
|
||||||
//searchUrls.Add(String.Format("{0}&limit=100&q={1}+Season", url, searchModel.SeriesTitle));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.DailySearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&limit=100&q={1}+{2:yyyy MM dd}", url, searchModel.SeriesTitle,
|
|
||||||
searchModel.AirDate));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return searchUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
||||||
{
|
{
|
||||||
@ -79,7 +85,7 @@ private string[] GetUrls()
|
|||||||
var urls = new List<string>();
|
var urls = new List<string>();
|
||||||
var newznzbIndexers = _newznabProvider.Enabled();
|
var newznzbIndexers = _newznabProvider.Enabled();
|
||||||
|
|
||||||
foreach(var newznabDefinition in newznzbIndexers)
|
foreach (var newznabDefinition in newznzbIndexers)
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrWhiteSpace(newznabDefinition.ApiKey))
|
if (!String.IsNullOrWhiteSpace(newznabDefinition.ApiKey))
|
||||||
urls.Add(String.Format("{0}/api?t=tvsearch&cat=5030,5040&apikey={1}", newznabDefinition.Url,
|
urls.Add(String.Format("{0}/api?t=tvsearch&cat=5030,5040&apikey={1}", newznabDefinition.Url,
|
||||||
|
@ -4,15 +4,15 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Providers.Core;
|
using NzbDrone.Core.Providers.Core;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Indexer
|
namespace NzbDrone.Core.Providers.Indexer
|
||||||
{
|
{
|
||||||
public class NzbMatrix : IndexerBase
|
public class NzbMatrix : IndexerBase
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
public NzbMatrix(HttpProvider httpProvider, ConfigProvider configProvider) : base(httpProvider, configProvider)
|
public NzbMatrix(HttpProvider httpProvider, ConfigProvider configProvider)
|
||||||
|
: base(httpProvider, configProvider)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,6 +30,55 @@ protected override string[] Urls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
|
{
|
||||||
|
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 IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<String>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&term={1}+{2:yyyy MM dd}", url, seriesTitle, date));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<String>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&term={1}+Season", url, seriesTitle));
|
||||||
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}", url, seriesTitle, seasonNumber));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<String>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
public override string Name
|
public override string Name
|
||||||
{
|
{
|
||||||
get { return "NzbMatrix"; }
|
get { return "NzbMatrix"; }
|
||||||
@ -41,40 +90,6 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
|||||||
return item.Links[0].Uri.ToString();
|
return item.Links[0].Uri.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
|
||||||
{
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.PartialSeasonSearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}E{3}",
|
|
||||||
url, searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodePrefix));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.SeasonSearch)
|
|
||||||
{
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.DailySearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&term={1}+{2:yyyy MM dd}", url, searchModel.SeriesTitle,
|
|
||||||
searchModel.AirDate));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return searchUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
||||||
{
|
{
|
||||||
if (currentResult != null)
|
if (currentResult != null)
|
||||||
|
@ -4,14 +4,13 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Providers.Core;
|
using NzbDrone.Core.Providers.Core;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Indexer
|
namespace NzbDrone.Core.Providers.Indexer
|
||||||
{
|
{
|
||||||
public class NzbsOrg : IndexerBase
|
public class NzbsOrg : IndexerBase
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
public NzbsOrg(HttpProvider httpProvider, ConfigProvider configProvider)
|
public NzbsOrg(HttpProvider httpProvider, ConfigProvider configProvider)
|
||||||
: base(httpProvider, configProvider)
|
: base(httpProvider, configProvider)
|
||||||
{
|
{
|
||||||
@ -23,11 +22,62 @@ protected override string[] Urls
|
|||||||
{
|
{
|
||||||
return new[]
|
return new[]
|
||||||
{
|
{
|
||||||
string.Format("http://nzbs.org/rss.php?type=1&i={0}&h={1}&num=50&dl=1", _configProvider.NzbsOrgUId, _configProvider.NzbsOrgHash)
|
string.Format("http://nzbs.org/rss.php?type=1&i={0}&h={1}&num=50&dl=1",
|
||||||
|
_configProvider.NzbsOrgUId, _configProvider.NzbsOrgHash)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<String>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+s{2:00}e{3:00}", url, seriesTitle, seasonNumber, episodeNumber));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<String>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+{2:yyyy.MM.dd}", url, seriesTitle, date));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<String>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+Season", url, seriesTitle));
|
||||||
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}", url, seriesTitle, seasonNumber));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
|
{
|
||||||
|
var searchUrls = new List<String>();
|
||||||
|
|
||||||
|
foreach (var url in Urls)
|
||||||
|
{
|
||||||
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}E{3}",
|
||||||
|
url, seriesTitle, seasonNumber, episodeWildcard));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchUrls;
|
||||||
|
}
|
||||||
|
|
||||||
public override string Name
|
public override string Name
|
||||||
{
|
{
|
||||||
get { return "Nzbs.org"; }
|
get { return "Nzbs.org"; }
|
||||||
@ -39,40 +89,6 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
|||||||
return item.Id;
|
return item.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
|
||||||
{
|
|
||||||
var searchUrls = new List<String>();
|
|
||||||
|
|
||||||
foreach (var url in Urls)
|
|
||||||
{
|
|
||||||
if (searchModel.SearchType == SearchType.EpisodeSearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&action=search&q={1}+s{2:00}e{3:00}", url,
|
|
||||||
searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodeNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.PartialSeasonSearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}E{3}",
|
|
||||||
url, searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodePrefix));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.SeasonSearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&action=search&q={1}+Season", url, searchModel.SeriesTitle));
|
|
||||||
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}", url, searchModel.SeriesTitle, searchModel.SeasonNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchModel.SearchType == SearchType.DailySearch)
|
|
||||||
{
|
|
||||||
searchUrls.Add(String.Format("{0}&action=search&q={1}+{2:yyyy.MM.dd}", url, searchModel.SeriesTitle,
|
|
||||||
searchModel.AirDate));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return searchUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
||||||
{
|
{
|
||||||
if (currentResult != null)
|
if (currentResult != null)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ServiceModel.Syndication;
|
using System.ServiceModel.Syndication;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Providers.Core;
|
using NzbDrone.Core.Providers.Core;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Indexer
|
namespace NzbDrone.Core.Providers.Indexer
|
||||||
@ -39,7 +39,23 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
|||||||
return item.Links[0].Uri.ToString();
|
return item.Links[0].Uri.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
|
||||||
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
||||||
|
{
|
||||||
|
return new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
||||||
|
{
|
||||||
|
return new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
||||||
|
{
|
||||||
|
return new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
||||||
{
|
{
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.Model;
|
|
||||||
using NzbDrone.Core.Model.Notification;
|
using NzbDrone.Core.Model.Notification;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Repository;
|
using NzbDrone.Core.Repository;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Jobs
|
namespace NzbDrone.Core.Providers.Jobs
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.Model;
|
|
||||||
using NzbDrone.Core.Model.Notification;
|
using NzbDrone.Core.Model.Notification;
|
||||||
using NzbDrone.Core.Model.Search;
|
|
||||||
using NzbDrone.Core.Repository;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Providers.Jobs
|
namespace NzbDrone.Core.Providers.Jobs
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
.searchImage:hover, .renameImage:hover, .ignoreEpisode:hover, .ignoreEpisodesMaster:hover
|
.searchImage:hover, .renameImage:hover, .ignoreEpisode:hover, .ignoreEpisodesMaster:hover
|
||||||
{
|
{
|
||||||
background-color: #065EFE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#banner-container
|
#banner-container
|
||||||
@ -110,10 +110,10 @@
|
|||||||
.TableHtmlAttributes(new { @class = "Grid" })
|
.TableHtmlAttributes(new { @class = "Grid" })
|
||||||
.Columns(columns =>
|
.Columns(columns =>
|
||||||
{
|
{
|
||||||
columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode");
|
columns.Bound(c => c.EpisodeNumber).Width(50).Title("Episode");
|
||||||
columns.Bound(c => c.Title).Title("Title");
|
columns.Bound(c => c.Title).Title("Title");
|
||||||
columns.Bound(c => c.AirDate).Width(0);
|
columns.Bound(c => c.AirDate).Width(100);
|
||||||
columns.Bound(c => c.Quality).Width(0);
|
columns.Bound(c => c.Quality).Width(100);
|
||||||
columns.Bound(c => c.Status)
|
columns.Bound(c => c.Status)
|
||||||
.Title("<img src='../../Content/Images/ignoredNeutral.png' class='ignoredEpisodesMaster ignoreEpisode ignoreSeason_" + season + "' title='Click to toggle season ignore status' />" +
|
.Title("<img src='../../Content/Images/ignoredNeutral.png' class='ignoredEpisodesMaster ignoreEpisode ignoreSeason_" + season + "' title='Click to toggle season ignore status' />" +
|
||||||
"<img src='../../Content/Images/Missing.png' alt='Status' title='Season Status' class='statusImage statusImageMaster' />" +
|
"<img src='../../Content/Images/Missing.png' alt='Status' title='Season Status' class='statusImage statusImageMaster' />" +
|
||||||
|
Loading…
Reference in New Issue
Block a user