Merge pull request #2655 from lfoust/tvdbruntimefix

Fix FormatException when mapping TVDB series
This commit is contained in:
Bond-009 2020-03-24 22:04:24 +01:00 committed by GitHub
commit 632323969f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -344,7 +344,11 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
series.ProductionYear = date.Year;
}
series.RunTimeTicks = TimeSpan.FromMinutes(Convert.ToDouble(tvdbSeries.Runtime)).Ticks;
if (!string.IsNullOrEmpty(tvdbSeries.Runtime) && double.TryParse(tvdbSeries.Runtime, out double runtime))
{
series.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks;
}
foreach (var genre in tvdbSeries.Genre)
{
series.AddGenre(genre);