Don't send full paths to Skyhook for searches

This commit is contained in:
Mark McDowall 2025-11-26 18:08:57 -08:00
parent 0809a72ce5
commit 7e1c964797
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View file

@ -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)
{
}
}

View file

@ -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();