mirror of
https://github.com/Radarr/Radarr
synced 2024-12-31 20:35:37 +00:00
Set year to current year when show doesn't have a valid year
This commit is contained in:
parent
74ac67eab1
commit
ca429cf5de
1 changed files with 10 additions and 1 deletions
|
@ -71,7 +71,7 @@ private static Series MapSeries(Show show)
|
|||
series.ImdbId = show.imdb_id;
|
||||
series.Title = 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.Overview = show.overview;
|
||||
series.Runtime = show.runtime;
|
||||
|
@ -159,5 +159,14 @@ private static string GetSearchTerm(string 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue