You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.TV/Plugin.cs

41 lines
1.2 KiB

using System;
using System.ComponentModel.Composition;
using MediaBrowser.Common.Plugins;
13 years ago
using MediaBrowser.Controller;
using MediaBrowser.Controller.Events;
using MediaBrowser.Model.Plugins;
13 years ago
using MediaBrowser.TV.Entities;
namespace MediaBrowser.TV
{
[Export(typeof(BasePlugin))]
public class Plugin : BaseGenericPlugin<BasePluginConfiguration>
13 years ago
{
public override string Name
{
get { return "TV"; }
}
public override void Init()
13 years ago
{
Kernel.Instance.ItemController.PreBeginResolvePath += ItemController_PreBeginResolvePath;
}
public override void Dispose()
{
Kernel.Instance.ItemController.PreBeginResolvePath -= ItemController_PreBeginResolvePath;
}
13 years ago
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;
}
}
}
}
}