2012-07-26 04:33:11 +02:00
|
|
|
|
using System.ComponentModel.Composition;
|
|
|
|
|
using MediaBrowser.Common.Plugins;
|
2012-07-12 08:55:27 +02:00
|
|
|
|
using MediaBrowser.Controller;
|
2012-07-24 16:54:34 +02:00
|
|
|
|
using MediaBrowser.Model.Plugins;
|
2012-07-12 08:55:27 +02:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.HtmlBrowser
|
|
|
|
|
{
|
2012-07-26 04:33:11 +02:00
|
|
|
|
[Export(typeof(BasePlugin))]
|
2012-07-24 16:54:34 +02:00
|
|
|
|
public class Plugin : BaseGenericPlugin<BasePluginConfiguration>
|
2012-07-12 08:55:27 +02:00
|
|
|
|
{
|
2012-07-24 16:54:34 +02:00
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Html Library Browser"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void InitInServer()
|
2012-07-12 08:55:27 +02:00
|
|
|
|
{
|
2012-07-13 05:50:50 +02:00
|
|
|
|
var httpServer = Kernel.Instance.HttpServer;
|
|
|
|
|
|
2012-07-20 04:22:44 +02:00
|
|
|
|
/*httpServer.Where(ctx => ctx.LocalPath.IndexOf("/browser/", StringComparison.OrdinalIgnoreCase) != -1).Subscribe(ctx =>
|
2012-07-14 22:45:11 +02:00
|
|
|
|
{
|
|
|
|
|
string localPath = ctx.LocalPath;
|
|
|
|
|
string srch = "/browser/";
|
2012-07-13 05:50:50 +02:00
|
|
|
|
|
2012-07-14 22:45:11 +02:00
|
|
|
|
int index = localPath.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
|
2012-07-13 05:50:50 +02:00
|
|
|
|
|
2012-07-14 22:45:11 +02:00
|
|
|
|
string resource = localPath.Substring(index + srch.Length);
|
|
|
|
|
|
|
|
|
|
ctx.Respond(new EmbeddedResourceHandler(ctx, resource));
|
|
|
|
|
|
2012-07-20 04:22:44 +02:00
|
|
|
|
});*/
|
2012-07-12 08:55:27 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|