DeprecatePlugins.cs 729 B

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