aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs
blob: afdd4e623fba8531a2e3a150c0a305b3905667cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using MediaBrowser.Common.IO;
using MediaBrowser.Controller;
using System.IO;

namespace MediaBrowser.Server.Startup.Common.Migrations
{
    public class DeprecatePlugins : IVersionMigration
    {
        private readonly IServerApplicationPaths _appPaths;
        private readonly IFileSystem _fileSystem;

        public DeprecatePlugins(IServerApplicationPaths appPaths, IFileSystem fileSystem)
        {
            _appPaths = appPaths;
            _fileSystem = fileSystem;
        }

        public void Run()
        {
            RemovePlugin("MediaBrowser.Plugins.LocalTrailers.dll");
        }

        private void RemovePlugin(string filename)
        {
            try
            {
                _fileSystem.DeleteFile(Path.Combine(_appPaths.PluginsPath, filename));
            }
            catch
            {
                
            }
        }
    }
}