diff --git a/MediaBrowser.Providers/Savers/AlbumXmlSaver.cs b/MediaBrowser.Providers/Savers/AlbumXmlSaver.cs index 829a80d318..76e4c45d02 100644 --- a/MediaBrowser.Providers/Savers/AlbumXmlSaver.cs +++ b/MediaBrowser.Providers/Savers/AlbumXmlSaver.cs @@ -58,7 +58,7 @@ namespace MediaBrowser.Providers.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath); + XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { }); // Set last refreshed so that the provider doesn't trigger after the file save PersonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow); diff --git a/MediaBrowser.Providers/Savers/ArtistXmlSaver.cs b/MediaBrowser.Providers/Savers/ArtistXmlSaver.cs index 1ad9297317..a84575b19d 100644 --- a/MediaBrowser.Providers/Savers/ArtistXmlSaver.cs +++ b/MediaBrowser.Providers/Savers/ArtistXmlSaver.cs @@ -58,7 +58,7 @@ namespace MediaBrowser.Providers.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath); + XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { }); // Set last refreshed so that the provider doesn't trigger after the file save PersonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow); diff --git a/MediaBrowser.Providers/Savers/EpisodeXmlSaver.cs b/MediaBrowser.Providers/Savers/EpisodeXmlSaver.cs index 524c1dc97b..d17325c85a 100644 --- a/MediaBrowser.Providers/Savers/EpisodeXmlSaver.cs +++ b/MediaBrowser.Providers/Savers/EpisodeXmlSaver.cs @@ -80,7 +80,13 @@ namespace MediaBrowser.Providers.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath); + XmlSaverHelpers.Save(builder, xmlFilePath, new[] + { + "FirstAired", + "SeasonNumber", + "EpisodeNumber", + "EpisodeName" + }); // Set last refreshed so that the provider doesn't trigger after the file save EpisodeProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow); diff --git a/MediaBrowser.Providers/Savers/FolderXmlSaver.cs b/MediaBrowser.Providers/Savers/FolderXmlSaver.cs index f348fccca1..0cc974432c 100644 --- a/MediaBrowser.Providers/Savers/FolderXmlSaver.cs +++ b/MediaBrowser.Providers/Savers/FolderXmlSaver.cs @@ -53,7 +53,7 @@ namespace MediaBrowser.Providers.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath); + XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { }); } /// diff --git a/MediaBrowser.Providers/Savers/MovieXmlSaver.cs b/MediaBrowser.Providers/Savers/MovieXmlSaver.cs index c83a978d7b..32ec765b0f 100644 --- a/MediaBrowser.Providers/Savers/MovieXmlSaver.cs +++ b/MediaBrowser.Providers/Savers/MovieXmlSaver.cs @@ -64,7 +64,7 @@ namespace MediaBrowser.Providers.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath); + XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { }); // Set last refreshed so that the provider doesn't trigger after the file save MovieProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow); diff --git a/MediaBrowser.Providers/Savers/PersonXmlSaver.cs b/MediaBrowser.Providers/Savers/PersonXmlSaver.cs index fb11c148a9..349b5e1a99 100644 --- a/MediaBrowser.Providers/Savers/PersonXmlSaver.cs +++ b/MediaBrowser.Providers/Savers/PersonXmlSaver.cs @@ -47,7 +47,7 @@ namespace MediaBrowser.Providers.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath); + XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { }); // Set last refreshed so that the provider doesn't trigger after the file save PersonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow); diff --git a/MediaBrowser.Providers/Savers/SeriesXmlSaver.cs b/MediaBrowser.Providers/Savers/SeriesXmlSaver.cs index b2ac44b905..535540d00a 100644 --- a/MediaBrowser.Providers/Savers/SeriesXmlSaver.cs +++ b/MediaBrowser.Providers/Savers/SeriesXmlSaver.cs @@ -92,7 +92,15 @@ namespace MediaBrowser.Providers.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath); + XmlSaverHelpers.Save(builder, xmlFilePath, new[] + { + "id", + "SeriesName", + "Status", + "Network", + "Airs_Time", + "Airs_DayOfWeek" + }); // Set last refreshed so that the provider doesn't trigger after the file save SeriesProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow); diff --git a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs index a58da0710e..88d6ebec0e 100644 --- a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs +++ b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs @@ -2,8 +2,10 @@ using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Model.Entities; using System; +using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Linq; using System.Security; using System.Text; using System.Xml; @@ -25,8 +27,55 @@ namespace MediaBrowser.Providers.Savers /// /// The XML. /// The path. - public static void Save(StringBuilder xml, string path) + /// The XML tags used. + public static void Save(StringBuilder xml, string path, IEnumerable xmlTagsUsed) { + if (File.Exists(path)) + { + var tags = xmlTagsUsed.ToList(); + + tags.AddRange(new[] + { + "MediaInfo", + "ContentRating", + "MPAARating", + "certification", + "Persons", + "Type", + "Overview", + "CustomRating", + "LocalTitle", + "SortTitle", + "PremiereDate", + "Budget", + "Revenue", + "Rating", + "ProductionYear", + "Website", + "AspectRatio", + "Language", + "RunningTime", + "Runtime", + "TagLine", + "TagLines", + "IMDB_ID", + "IMDB", + "IMDbId", + "TMDbId", + "TVcomId", + "RottenTomatoesId", + "MusicbrainzId", + "CollectionNumber", + "Genres", + "Studios", + "Tags", + "Added" + }); + + var position = xml.ToString().LastIndexOf(" + /// Gets the custom tags. + /// + /// The path. + /// The XML tags used. + /// System.String. + private static string GetCustomTags(string path, ICollection xmlTagsUsed) + { + var doc = new XmlDocument(); + doc.Load(path); + + var nodes = doc.DocumentElement.ChildNodes.Cast() + .Where(i => !xmlTagsUsed.Contains(i.Name)) + .Select(i => i.OuterXml) + .ToArray(); + + return string.Join(Environment.NewLine, nodes); + } + /// /// Adds the common nodes. /// @@ -105,7 +173,7 @@ namespace MediaBrowser.Providers.Savers { builder.Append("" + SecurityElement.Escape(item.PremiereDate.Value.ToString("yyyy-MM-dd")) + ""); } - + if (item.Budget.HasValue) { builder.Append("" + SecurityElement.Escape(item.Budget.Value.ToString(UsCulture)) + ""); @@ -125,7 +193,7 @@ namespace MediaBrowser.Providers.Savers { builder.Append("" + SecurityElement.Escape(item.ProductionYear.Value.ToString(UsCulture)) + ""); } - + if (!string.IsNullOrEmpty(item.HomePageUrl)) { builder.Append("" + SecurityElement.Escape(item.HomePageUrl) + ""); @@ -148,7 +216,7 @@ namespace MediaBrowser.Providers.Savers builder.Append("" + Convert.ToInt32(timespan.TotalMinutes).ToString(UsCulture) + ""); builder.Append("" + Convert.ToInt32(timespan.TotalMinutes).ToString(UsCulture) + ""); } - + if (item.Taglines.Count > 0) { builder.Append("" + SecurityElement.Escape(item.Taglines[0]) + ""); @@ -199,7 +267,7 @@ namespace MediaBrowser.Providers.Savers { builder.Append("" + SecurityElement.Escape(mbz) + ""); } - + var tmdbCollection = item.GetProviderId(MetadataProviders.TmdbCollection); if (!string.IsNullOrEmpty(tmdbCollection)) diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index 8b419abab1..aa7d45b5bc 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -126,23 +126,8 @@ ..\packages\MahApps.Metro.0.11.0.17-ALPHA\lib\net45\MahApps.Metro.dll - - False - ..\packages\MediaBrowser.Common.3.0.123\lib\net45\MediaBrowser.Common.dll - - - False - ..\packages\MediaBrowser.IsoMounting.3.0.53\lib\net45\MediaBrowser.IsoMounter.dll - - - False - ..\packages\MediaBrowser.Common.3.0.123\lib\net45\MediaBrowser.Model.dll - - - ..\packages\Microsoft.Bcl.Async.1.0.16\lib\net45\Microsoft.Threading.Tasks.dll - - - ..\packages\Microsoft.Bcl.Async.1.0.16\lib\net45\Microsoft.Threading.Tasks.Extensions.dll + + ..\packages\MediaBrowser.IsoMounting.3.0.55\lib\net45\MediaBrowser.IsoMounter.dll False @@ -152,9 +137,8 @@ False ..\packages\NLog.2.0.1.2\lib\net45\NLog.dll - - False - ..\packages\MediaBrowser.IsoMounting.3.0.53\lib\net45\pfmclrapi.dll + + ..\packages\MediaBrowser.IsoMounting.3.0.55\lib\net45\pfmclrapi.dll False @@ -298,10 +282,18 @@ {c4d2573a-3fd3-441f-81af-174ac4cd4e1d} MediaBrowser.Common.Implementations + + {9142eefa-7570-41e1-bfcc-468bb571af2f} + MediaBrowser.Common + {17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2} MediaBrowser.Controller + + {7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b} + MediaBrowser.Model + {442b5058-dcaf-4263-bb6a-f21e31120a1b} MediaBrowser.Providers @@ -430,5 +422,4 @@ del "$(SolutionDir)..\Deploy\MBServer.zip" - \ No newline at end of file diff --git a/MediaBrowser.ServerApplication/packages.config b/MediaBrowser.ServerApplication/packages.config index 15fd50aeb8..d994c6e0ff 100644 --- a/MediaBrowser.ServerApplication/packages.config +++ b/MediaBrowser.ServerApplication/packages.config @@ -3,11 +3,7 @@ - - - - - +