From e95837ff536599984f6a0a7dfc91b9aec9a85757 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 13 Jun 2013 15:01:28 -0400 Subject: [PATCH] don't overwrite ffmpeg runtime with xml value --- .../Providers/BaseItemXmlParser.cs | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 6f246ef40..0a7fefbc5 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -1,13 +1,13 @@ -using System.Globalization; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; +using System.Globalization; +using System.IO; using System.Linq; +using System.Text; using System.Threading; using System.Xml; @@ -226,7 +226,15 @@ namespace MediaBrowser.Controller.Providers int runtime; if (int.TryParse(text.Split(' ')[0], out runtime)) { - item.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks; + // For audio and video don't replace ffmpeg data + if (item is Video || item is Audio) + { + item.OriginalRunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks; + } + else + { + item.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks; + } } } break; @@ -415,10 +423,10 @@ namespace MediaBrowser.Controller.Providers case "IMDB_ID": case "IMDB": case "IMDbId": - var IMDbId = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(IMDbId)) + var imDbId = reader.ReadElementContentAsString(); + if (!string.IsNullOrWhiteSpace(imDbId)) { - item.SetProviderId(MetadataProviders.Imdb, IMDbId); + item.SetProviderId(MetadataProviders.Imdb, imDbId); } break;