The Free Software Media System - Server Backend & API
read/write remote trailers to xml
Luke Pulverenti42a2522637d1
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.csindex 67d9cf7a47..9ad0703ae6 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 streamingif (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.csindex 8ee622eda9..14c83bed43 100644--- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs+++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs@@ -68,6 +68,7 @@ namespace MediaBrowser.Controller.Providersitem.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.Providersbreak;}+ 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.csindex a0c830db4a..5a49e4f36b 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.Saversif (item.RemoteTrailers.Count > 0){- builder.Append("<Trailer>" + SecurityElement.Escape(item.RemoteTrailers[0].Url) + "</Trailer>");+ builder.Append("<Trailers>");++ foreach (var trailer in item.RemoteTrailers)+ {+ builder.Append("<Trailer>" + SecurityElement.Escape(trailer.Url) + "</Trailer>");+ }++ builder.Append("</Trailers>");}if (item.Budget.HasValue)diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.csindex 17508b2bdc..fc89441aef 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("<script src=\"{0}\"></script>", s)).ToArray();diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csprojindex e9a70ad973..3b2714b2d9 100644--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj@@ -610,76 +610,76 @@<Content Include="dashboard-ui\thirdparty\html5slider.js"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\jquery.jstree.js">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\jquery.jstree.js"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\apple\bg.jpg">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\apple\bg.jpg"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\apple\d.png">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\apple\d.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\apple\dot_for_ie.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\apple\dot_for_ie.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\apple\style.css">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\apple\style.css"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\apple\throbber.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\apple\throbber.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\classic\d.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\classic\d.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\classic\d.png">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\classic\d.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\classic\dot_for_ie.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\classic\dot_for_ie.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\classic\style.css">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\classic\style.css"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\classic\throbber.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\classic\throbber.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default-rtl\d.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default-rtl\d.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default-rtl\d.png">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default-rtl\d.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default-rtl\dots.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default-rtl\dots.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default-rtl\style.css">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default-rtl\style.css"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default-rtl\throbber.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default-rtl\throbber.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default\d.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default\d.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default\d.png">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default\d.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default\style.css">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default\style.css"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\default\throbber.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\default\throbber.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\mb3\d.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\mb3\d.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\mb3\d.png">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\mb3\d.png"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\mb3\style.css">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\mb3\style.css"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>- <Content Include="dashboard-ui\thirdparty\jstree1.0fix3\themes\mb3\throbber.gif">+ <Content Include="dashboard-ui\thirdparty\jstree1.0\themes\mb3\throbber.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content><Content Include="dashboard-ui\tvgenres.html">diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.configindex 4fa4e5a9ec..f13a431e3a 100644--- a/MediaBrowser.WebDashboard/packages.config+++ b/MediaBrowser.WebDashboard/packages.config@@ -1,6 +1,6 @@<?xml version="1.0" encoding="utf-8"?><packages>- <package id="MediaBrowser.ApiClient.Javascript" version="3.0.203" targetFramework="net45" />+ <package id="MediaBrowser.ApiClient.Javascript" version="3.0.204" targetFramework="net45" /><package id="ServiceStack.Common" version="3.9.70" targetFramework="net45" /><package id="ServiceStack.Text" version="3.9.70" targetFramework="net45" /></packages>\ No newline at end of file