1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-01-03 22:04:43 +00:00

Set year to current year when show doesn't have a valid year

This commit is contained in:
Mark McDowall 2013-09-26 20:40:36 -07:00
parent 74ac67eab1
commit ca429cf5de

View file

@ -71,7 +71,7 @@ private static Series MapSeries(Show show)
series.ImdbId = show.imdb_id; series.ImdbId = show.imdb_id;
series.Title = show.title; series.Title = show.title;
series.CleanTitle = Parser.Parser.CleanSeriesTitle(show.title); series.CleanTitle = Parser.Parser.CleanSeriesTitle(show.title);
series.Year = show.year; series.Year = GetYear(show.year, show.first_aired);
series.FirstAired = FromIso(show.first_aired_iso); series.FirstAired = FromIso(show.first_aired_iso);
series.Overview = show.overview; series.Overview = show.overview;
series.Runtime = show.runtime; series.Runtime = show.runtime;
@ -159,5 +159,14 @@ private static string GetSearchTerm(string phrase)
return phrase; return phrase;
} }
private static int GetYear(int year, int firstAired)
{
if (year > 1969) return year;
if (firstAired == 0) return DateTime.Today.Year;
return year;
}
} }
} }