jellyfin/MediaBrowser.TV/Plugin.cs

42 lines
1.3 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.Library;
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"; }
}
protected override void InitializeOnServer()
2012-07-12 06:55:27 +00:00
{
Kernel.Instance.ItemController.PreBeginResolvePath += ItemController_PreBeginResolvePath;
}
protected override void DisposeOnServer()
{
Kernel.Instance.ItemController.PreBeginResolvePath -= ItemController_PreBeginResolvePath;
}
2012-07-12 06:55:27 +00:00
void ItemController_PreBeginResolvePath(object sender, PreBeginResolveEventArgs e)
{
// Don't try and resolve files with the metadata folder
2012-08-21 14:42:40 +00:00
if (System.IO.Path.GetFileName(e.Path).Equals("metadata", StringComparison.OrdinalIgnoreCase) && e.IsDirectory)
2012-07-12 06:55:27 +00:00
{
if (e.Parent is Season || e.Parent is Series)
{
e.Cancel = true;
}
}
}
}
}