From c896833607887a6b658e942e28ed50f98f73b592 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 21 Jun 2020 22:11:45 -0400 Subject: [PATCH] Fixed: Don't fail lookup on some IMDB Searches Fixes #4533 --- src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 0f3cc9be4..bbd62e940 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -317,6 +317,8 @@ public List SearchForNewMovie(string title) lowerTitle = lowerTitle.Replace(".", ""); + var parserTitle = lowerTitle; + var parserResult = Parser.Parser.ParseMovieTitle(title, true); var yearTerm = ""; @@ -324,7 +326,7 @@ public List SearchForNewMovie(string title) if (parserResult != null && parserResult.MovieTitle != title) { //Parser found something interesting! - lowerTitle = parserResult.MovieTitle.ToLower().Replace(".", " "); //TODO Update so not every period gets replaced (e.g. R.I.P.D.) + parserTitle = parserResult.MovieTitle.ToLower().Replace(".", " "); //TODO Update so not every period gets replaced (e.g. R.I.P.D.) if (parserResult.Year > 1800) { yearTerm = parserResult.Year.ToString(); @@ -343,7 +345,7 @@ public List SearchForNewMovie(string title) } } - lowerTitle = StripTrailingTheFromTitle(lowerTitle); + parserTitle = StripTrailingTheFromTitle(parserTitle); if (lowerTitle.StartsWith("imdb:") || lowerTitle.StartsWith("imdbid:")) { @@ -387,7 +389,7 @@ public List SearchForNewMovie(string title) } } - var searchTerm = lowerTitle.Replace("_", "+").Replace(" ", "+").Replace(".", "+"); + var searchTerm = parserTitle.Replace("_", "+").Replace(" ", "+").Replace(".", "+"); var firstChar = searchTerm.First();