DeprecatePlugins.cs 882 B

1234567891011121314151617181920212223242526272829303132333435
  1. using MediaBrowser.Common.IO;
  2. using MediaBrowser.Controller;
  3. using System.IO;
  4. namespace MediaBrowser.Server.Startup.Common.Migrations
  5. {
  6. public class DeprecatePlugins : IVersionMigration
  7. {
  8. private readonly IServerApplicationPaths _appPaths;
  9. private readonly IFileSystem _fileSystem;
  10. public DeprecatePlugins(IServerApplicationPaths appPaths, IFileSystem fileSystem)
  11. {
  12. _appPaths = appPaths;
  13. _fileSystem = fileSystem;
  14. }
  15. public void Run()
  16. {
  17. RemovePlugin("MediaBrowser.Plugins.LocalTrailers.dll");
  18. }
  19. private void RemovePlugin(string filename)
  20. {
  21. try
  22. {
  23. _fileSystem.DeleteFile(Path.Combine(_appPaths.PluginsPath, filename));
  24. }
  25. catch
  26. {
  27. }
  28. }
  29. }
  30. }