aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/Migrations/DeprecatePlugins.cs
blob: ce4665b26cafc7db5f4a6d6c6fe14f3acece0925 (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
using MediaBrowser.Controller;
using System.IO;

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

        public DeprecatePlugins(IServerApplicationPaths appPaths)
        {
            _appPaths = appPaths;
        }

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

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