mirror of
https://github.com/Radarr/Radarr
synced 2025-01-01 12:54:21 +00:00
Fix error with null dates
This commit is contained in:
parent
83560ad937
commit
e0f72e4853
1 changed files with 8 additions and 8 deletions
|
@ -142,18 +142,18 @@ public Movie GetMovieInfo(int TmdbId, Profile profile = null)
|
|||
if (resource.release_date.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
movie.InCinemas = DateTime.Parse(resource.release_date);
|
||||
}
|
||||
|
||||
// get the lowest year in all release date
|
||||
var lowestYear = new List<int>();
|
||||
foreach (ReleaseDates releaseDates in resource.release_dates.results)
|
||||
{
|
||||
foreach (ReleaseDate releaseDate in releaseDates.release_dates)
|
||||
// get the lowest year in all release date
|
||||
var lowestYear = new List<int>();
|
||||
foreach (ReleaseDates releaseDates in resource.release_dates.results)
|
||||
{
|
||||
lowestYear.Add(DateTime.Parse(releaseDate.release_date).Year);
|
||||
foreach (ReleaseDate releaseDate in releaseDates.release_dates)
|
||||
{
|
||||
lowestYear.Add(DateTime.Parse(releaseDate.release_date).Year);
|
||||
}
|
||||
}
|
||||
movie.Year = lowestYear.Min();
|
||||
}
|
||||
movie.Year = lowestYear.Min();
|
||||
|
||||
movie.TitleSlug += "-" + movie.TmdbId.ToString();
|
||||
|
||||
|
|
Loading…
Reference in a new issue