Fixed: Many torrent indexers use full ImdbId instead of int version

Fixes #192
This commit is contained in:
Qstick
2021-06-12 01:37:01 -04:00
parent b4a0c272c9
commit d1a3e61979
24 changed files with 56 additions and 56 deletions

View File

@@ -10,6 +10,7 @@ using NzbDrone.Common.Http;
using NzbDrone.Core.Download;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.IndexerSearch;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using Prowlarr.Http.Extensions;
using Prowlarr.Http.REST;
@@ -51,6 +52,14 @@ namespace NzbDrone.Api.V1.Indexers
throw new BadRequestException("Missing Function Parameter");
}
if (request.imdbid.IsNotNullOrWhiteSpace())
{
if (!int.TryParse(request.imdbid, out var imdb) || imdb == 0)
{
throw new BadRequestException("Invalid Value for ImdbId");
}
}
var indexer = _indexerFactory.Get(id);
if (indexer == null)