diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 67d9cf7a4..9ad0703ae 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -695,7 +695,7 @@ namespace MediaBrowser.Api.Playback // This is arbitrary, but add a little buffer time when internet streaming if (state.Item.LocationType == LocationType.Remote) { - await Task.Delay(2000).ConfigureAwait(false); + await Task.Delay(4000).ConfigureAwait(false); } } diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 8ee622eda..14c83bed4 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -68,6 +68,7 @@ namespace MediaBrowser.Controller.Providers item.Genres.Clear(); item.People.Clear(); item.Tags.Clear(); + item.RemoteTrailers.Clear(); //Fetch(item, metadataFile, settings, Encoding.GetEncoding("ISO-8859-1"), cancellationToken); Fetch(item, metadataFile, settings, Encoding.UTF8, cancellationToken); @@ -482,6 +483,15 @@ namespace MediaBrowser.Controller.Providers break; } + case "Trailers": + { + using (var subtree = reader.ReadSubtree()) + { + FetchDataFromTrailersNode(subtree, item); + } + break; + } + case "ReleaseYear": case "ProductionYear": { @@ -922,6 +932,35 @@ namespace MediaBrowser.Controller.Providers } } + private void FetchDataFromTrailersNode(XmlReader reader, T item) + { + reader.MoveToContent(); + + while (reader.Read()) + { + if (reader.NodeType == XmlNodeType.Element) + { + switch (reader.Name) + { + case "Trailer": + { + var val = reader.ReadElementContentAsString(); + + if (!string.IsNullOrWhiteSpace(val)) + { + item.AddTrailerUrl(val, false); + } + break; + } + + default: + reader.Skip(); + break; + } + } + } + } + protected async Task FetchChaptersFromXmlNode(BaseItem item, XmlReader reader, IItemRepository repository, CancellationToken cancellationToken) { var runtime = item.RunTimeTicks ?? 0; diff --git a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs index a0c830db4..5a49e4f36 100644 --- a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs +++ b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs @@ -63,6 +63,7 @@ namespace MediaBrowser.Providers.Savers "TMDbCollectionId", "TMDbId", "Trailer", + "Trailers", "TVcomId", "TvDbId", "Type", @@ -177,7 +178,7 @@ namespace MediaBrowser.Providers.Savers } } } - + return builder.ToString(); } @@ -269,7 +270,14 @@ namespace MediaBrowser.Providers.Savers if (item.RemoteTrailers.Count > 0) { - builder.Append("" + SecurityElement.Escape(item.RemoteTrailers[0].Url) + ""); + builder.Append(""); + + foreach (var trailer in item.RemoteTrailers) + { + builder.Append("" + SecurityElement.Escape(trailer.Url) + ""); + } + + builder.Append(""); } if (item.Budget.HasValue) diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 17508b2bd..fc89441ae 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -430,7 +430,7 @@ namespace MediaBrowser.WebDashboard.Api "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", "http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js", "scripts/all.js" + versionString, - "thirdparty/jstree1.0fix3/jquery.jstree.js" + "thirdparty/jstree1.0/jquery.jstree.js" }; var tags = files.Select(s => string.Format("", s)).ToArray(); diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index e9a70ad97..3b2714b2d 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -610,76 +610,76 @@ PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index 4fa4e5a9e..f13a431e3 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file