mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Don't send full paths to Skyhook for searches
This commit is contained in:
parent
0809a72ce5
commit
7e1c964797
2 changed files with 18 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
using System.Net;
|
||||
using NzbDrone.Core.Exceptions;
|
||||
|
||||
namespace NzbDrone.Core.MetadataSource.SkyHook;
|
||||
|
||||
public class InvalidSearchTermException : NzbDroneClientException
|
||||
{
|
||||
public InvalidSearchTermException(string message, params object[] args)
|
||||
: base(HttpStatusCode.BadRequest, message, args)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
using System.Net;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Cloud;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.DataAugmentation.DailySeries;
|
||||
|
|
@ -106,6 +107,11 @@ public List<Series> SearchForNewSeriesByTmdbId(int tmdbId)
|
|||
|
||||
public List<Series> SearchForNewSeries(string title)
|
||||
{
|
||||
if (title.IsPathValid(PathValidationType.AnyOs))
|
||||
{
|
||||
throw new InvalidSearchTermException("Invalid search term '{0}'", title);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var lowerTitle = title.ToLowerInvariant();
|
||||
|
|
|
|||
Loading…
Reference in a new issue