Fixes #5674
@ -162,6 +162,7 @@ namespace NzbDrone.Core.Test.ParserTests
parsed.ImdbId.Should().Be(imdb);
}
[TestCase("asfd", null)]
[TestCase("123", "tt0000123")]
[TestCase("1234567", "tt1234567")]
[TestCase("tt1234567", "tt1234567")]
@ -125,6 +125,13 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
public Movie GetMovieByImdbId(string imdbId)
{
imdbId = Parser.Parser.NormalizeImdbId(imdbId);
if (imdbId == null)
return null;
var httpRequest = _radarrMetadata.Create()
.SetSegment("route", "movie/imdb")
.Resource(imdbId.ToString())
@ -357,6 +357,13 @@ namespace NzbDrone.Core.Parser
public static string NormalizeImdbId(string imdbId)
var imdbRegex = new Regex(@"^(\d{1,10}|(tt)\d{1,10})$");
if (!imdbRegex.IsMatch(imdbId))
if (imdbId.Length > 2)
imdbId = imdbId.Replace("tt", "").PadLeft(7, '0');