jellyfin/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs

36 lines
882 B
C#
Raw Normal View History

using MediaBrowser.Common.IO;
using MediaBrowser.Controller;
2014-11-14 06:27:10 +00:00
using System.IO;
namespace MediaBrowser.Server.Startup.Common.Migrations
{
public class DeprecatePlugins : IVersionMigration
{
private readonly IServerApplicationPaths _appPaths;
private readonly IFileSystem _fileSystem;
2014-11-14 06:27:10 +00:00
public DeprecatePlugins(IServerApplicationPaths appPaths, IFileSystem fileSystem)
2014-11-14 06:27:10 +00:00
{
_appPaths = appPaths;
_fileSystem = fileSystem;
2014-11-14 06:27:10 +00:00
}
public void Run()
{
RemovePlugin("MediaBrowser.Plugins.LocalTrailers.dll");
}
private void RemovePlugin(string filename)
{
try
{
_fileSystem.DeleteFile(Path.Combine(_appPaths.PluginsPath, filename));
2014-11-14 06:27:10 +00:00
}
catch
{
}
}
}
}