jellyfin/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs
2014-12-13 16:26:04 -05:00

43 lines
1.0 KiB
C#

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
{
}
}
}
}