diff options
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
3 files changed, 44 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 9da82197a..1d69cd325 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -346,6 +346,7 @@ namespace MediaBrowser.Server.Startup.Common new RenameXbmcOptions(ServerConfigurationManager).Run(); new RenameXmlOptions(ServerConfigurationManager).Run(); new DeprecatePlugins(ApplicationPaths).Run(); + new DeleteDlnaProfiles(ApplicationPaths).Run(); } /// <summary> diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index db525e8e4..b133f78e7 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -63,6 +63,7 @@ <Compile Include="FFMpeg\FFMpegInfo.cs" /> <Compile Include="FFMpeg\FFmpegValidator.cs" /> <Compile Include="INativeApp.cs" /> + <Compile Include="Migrations\DeleteDlnaProfiles.cs" /> <Compile Include="Migrations\DeprecatePlugins.cs" /> <Compile Include="Migrations\IVersionMigration.cs" /> <Compile Include="Migrations\MigrateUserFolders.cs" /> diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs new file mode 100644 index 000000000..8fe841ffc --- /dev/null +++ b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs @@ -0,0 +1,42 @@ +using MediaBrowser.Controller; +using System.IO; + +namespace MediaBrowser.Server.Startup.Common.Migrations +{ + public class DeleteDlnaProfiles : IVersionMigration + { + private readonly IServerApplicationPaths _appPaths; + + public DeleteDlnaProfiles(IServerApplicationPaths appPaths) + { + _appPaths = appPaths; + } + + public void Run() + { + RemoveProfile("Android"); + RemoveProfile("Windows Phone"); + RemoveProfile("Windows 8 RT"); + } + + private void RemoveProfile(string filename) + { + try + { + File.Delete(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system", filename + ".xml")); + } + catch + { + + } + try + { + File.Delete(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user", filename + ".xml")); + } + catch + { + + } + } + } +} |
