diff options
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs')
| -rw-r--r-- | MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs | 42 |
1 files changed, 42 insertions, 0 deletions
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 + { + + } + } + } +} |
