Fixed problem with TMDb list when Year is null, Revert using UrlPathEncode on newznab requests (#937)

* Fixed problem with TMDb list when Year is null

* Fuck it, just skip movies with no year. Once they have a year they will be automagically added if sync is enabled.

* Revert using UrlPathEncode on newznab requests
Devin Buhl 8 years ago committed by GitHub
parent 06bd6db601
commit 7a269efcbc

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.IndexerSearch.Definitions;
@ -57,37 +58,12 @@ namespace NzbDrone.Core.Indexers.Newznab
} }
else else
{ {
pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories, "search", $"&q={System.Web.HttpUtility.UrlPathEncode(Parser.Parser.NormalizeTitle(searchCriteria.Movie.Title))}%20{searchCriteria.Movie.Year}")); pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories, "search", $"&q={Parser.Parser.NormalizeTitle(searchCriteria.Movie.Title)}%20{searchCriteria.Movie.Year}"));
} }
return pageableRequests; return pageableRequests;
} }
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
private IEnumerable<IndexerRequest> GetPagedRequests(int maxPages, IEnumerable<int> categories, string searchType, string parameters) private IEnumerable<IndexerRequest> GetPagedRequests(int maxPages, IEnumerable<int> categories, string searchType, string parameters)
{ {
if (categories.Empty()) if (categories.Empty())
@ -117,9 +93,30 @@ namespace NzbDrone.Core.Indexers.Newznab
} }
} }
private static string NewsnabifyTitle(string title)
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{ {
return title.Replace("+", "%20"); return new IndexerPageableRequestChain();
} }
} }
} }

@ -15,24 +15,6 @@ namespace NzbDrone.Core.NetImport.CouchPotato
: base(httpClient, configService, parsingService, logger) : base(httpClient, configService, parsingService, logger)
{ } { }
/*public new virtual IEnumerable<ProviderDefinition> DefaultDefinitions
{
get
{
var config = (CouchPotatoSettings)new CouchPotatoSettings();
config.Link = "http://localhost";
config.Port = "5050";
yield return new NetImportDefinition
{
Name = "Localhost",
Enabled = config.Validate().IsValid && Enabled,
Implementation = GetType().Name,
Settings = config
};
}
}*/
public override INetImportRequestGenerator GetRequestGenerator() public override INetImportRequestGenerator GetRequestGenerator()
{ {
return new CouchPotatoRequestGenerator() { Settings = Settings }; return new CouchPotatoRequestGenerator() { Settings = Settings };

@ -15,8 +15,6 @@ namespace NzbDrone.Core.NetImport.CouchPotato
private NetImportResponse _importResponse; private NetImportResponse _importResponse;
private readonly Logger _logger; private readonly Logger _logger;
private static readonly Regex ReplaceEntities = new Regex("&[a-z]+;", RegexOptions.Compiled | RegexOptions.IgnoreCase);
public CouchPotatoParser(CouchPotatoSettings settings) public CouchPotatoParser(CouchPotatoSettings settings)
{ {
_settings = settings; _settings = settings;

@ -34,8 +34,7 @@ namespace NzbDrone.Core.NetImport.CouchPotato
[FieldDefinition(1, Label = "CouchPotato Port", HelpText = "Port your CoouchPootato uses.")] [FieldDefinition(1, Label = "CouchPotato Port", HelpText = "Port your CoouchPootato uses.")]
public int Port { get; set; } public int Port { get; set; }
[FieldDefinition(2, Label = "CouchPotato Url Base", [FieldDefinition(2, Label = "CouchPotato Url Base", HelpText = "UrlBase your CoouchPootato uses, leave blank for none")]
HelpText = "UrlBase your CoouchPootato uses, leave blank for none")]
public string UrlBase { get; set; } public string UrlBase { get; set; }
[FieldDefinition(3, Label = "CouchPotato API Key", HelpText = "CoouchPootato API Key.")] [FieldDefinition(3, Label = "CouchPotato API Key", HelpText = "CoouchPootato API Key.")]

@ -43,6 +43,12 @@ namespace NzbDrone.Core.NetImport.TMDb
foreach (var movie in jsonResponse.results) foreach (var movie in jsonResponse.results)
{ {
// Movies with no Year Fix
if (string.IsNullOrWhiteSpace(movie.release_date))
{
continue;
}
movies.AddIfNotNull(new Tv.Movie() movies.AddIfNotNull(new Tv.Movie()
{ {
Title = movie.title, Title = movie.title,
@ -70,6 +76,12 @@ namespace NzbDrone.Core.NetImport.TMDb
continue; continue;
} }
// Movies with no Year Fix
if (string.IsNullOrWhiteSpace(movie.release_date))
{
continue;
}
movies.AddIfNotNull(new Tv.Movie() movies.AddIfNotNull(new Tv.Movie()
{ {
Title = movie.title, Title = movie.title,

Loading…
Cancel
Save