From 6685aea1449d9737572aafe81bed962c79317225 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Tue, 10 Jan 2017 15:29:20 +0100 Subject: [PATCH] Movie search should now work, even when titles returned from the TMDB do not have a release date set. Fixes #27. --- .../MetadataSource/SkyHook/SkyHookProxy.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 2abd18fb2..478b6dd13 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -92,8 +92,11 @@ namespace NzbDrone.Core.MetadataSource.SkyHook movie.CleanTitle = Parser.Parser.CleanSeriesTitle(movie.Title); movie.Overview = resource.overview; movie.Website = resource.homepage; - movie.InCinemas = DateTime.Parse(resource.release_date); - movie.Year = movie.InCinemas.Value.Year; + if (resource.release_date.IsNotNullOrWhiteSpace()) + { + movie.InCinemas = DateTime.Parse(resource.release_date); + movie.Year = movie.InCinemas.Value.Year; + } var slugResult = _movieService.FindByTitleSlug(movie.TitleSlug); if (slugResult != null) @@ -328,7 +331,13 @@ namespace NzbDrone.Core.MetadataSource.SkyHook imdbMovie.Title = result.title; string titleSlug = result.title; imdbMovie.TitleSlug = titleSlug.ToLower().Replace(" ", "-"); - imdbMovie.Year = DateTime.Parse(result.release_date).Year; + + if (result.release_date.IsNotNullOrWhiteSpace()) + { + imdbMovie.Year = DateTime.Parse(result.release_date).Year; + } + + var slugResult = _movieService.FindByTitleSlug(imdbMovie.TitleSlug); if (slugResult != null)