jellyfin/MediaBrowser.TV/Plugin.cs

41 lines
1.2 KiB
C#
Raw Normal View History

using System;
using System.ComponentModel.Composition;
using MediaBrowser.Common.Plugins;
2012-07-12 06:55:27 +00:00
using MediaBrowser.Controller;
using MediaBrowser.Controller.Events;
using MediaBrowser.Model.Plugins;
2012-07-12 06:55:27 +00:00
using MediaBrowser.TV.Entities;
namespace MediaBrowser.TV
{
[Export(typeof(BasePlugin))]
public class Plugin : BaseGenericPlugin<BasePluginConfiguration>
2012-07-12 06:55:27 +00:00
{
public override string Name
{
get { return "TV"; }
}
public override void Init()
2012-07-12 06:55:27 +00:00
{
Kernel.Instance.ItemController.PreBeginResolvePath += ItemController_PreBeginResolvePath;
}
public override void Dispose()
{
Kernel.Instance.ItemController.PreBeginResolvePath -= ItemController_PreBeginResolvePath;
}
2012-07-12 06:55:27 +00:00
void ItemController_PreBeginResolvePath(object sender, PreBeginResolveEventArgs e)
{
if (e.IsFolder && System.IO.Path.GetFileName(e.Path).Equals("metadata", StringComparison.OrdinalIgnoreCase))
{
if (e.Parent is Season || e.Parent is Series)
{
e.Cancel = true;
}
}
}
}
}