using System; using MediaBrowser.Common.Plugins; using MediaBrowser.Controller; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Plugins; using MediaBrowser.TV.Entities; using MediaBrowser.TV.Resolvers; namespace MediaBrowser.TV { public class Plugin : BaseGenericPlugin { public override string Name { get { return "TV"; } } public override void InitInServer() { Kernel.Instance.AddBaseItemType(); Kernel.Instance.AddBaseItemType(); Kernel.Instance.AddBaseItemType(); Kernel.Instance.ItemController.PreBeginResolvePath += ItemController_PreBeginResolvePath; } 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; } } } } }