DeprecatePlugins.cs 898 B

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