2012-07-24 14:54:34 +00:00
|
|
|
|
using System;
|
2012-07-26 02:33:11 +00:00
|
|
|
|
using System.ComponentModel.Composition;
|
2012-07-24 14:54:34 +00:00
|
|
|
|
using MediaBrowser.Common.Plugins;
|
2012-07-12 06:55:27 +00:00
|
|
|
|
using MediaBrowser.Controller;
|
|
|
|
|
using MediaBrowser.Controller.Events;
|
2012-07-24 14:54:34 +00:00
|
|
|
|
using MediaBrowser.Model.Plugins;
|
2012-07-12 06:55:27 +00:00
|
|
|
|
using MediaBrowser.TV.Entities;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.TV
|
|
|
|
|
{
|
2012-07-26 02:33:11 +00:00
|
|
|
|
[Export(typeof(BasePlugin))]
|
2012-07-24 14:54:34 +00:00
|
|
|
|
public class Plugin : BaseGenericPlugin<BasePluginConfiguration>
|
2012-07-12 06:55:27 +00:00
|
|
|
|
{
|
2012-07-24 14:54:34 +00:00
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "TV"; }
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-29 15:19:25 +00:00
|
|
|
|
public override void Init()
|
2012-07-12 06:55:27 +00:00
|
|
|
|
{
|
|
|
|
|
Kernel.Instance.ItemController.PreBeginResolvePath += ItemController_PreBeginResolvePath;
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-29 15:19:25 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|