2012-07-24 14:54:34 +00:00
|
|
|
|
using MediaBrowser.Common.Plugins;
|
2012-07-12 06:55:27 +00:00
|
|
|
|
using MediaBrowser.Controller;
|
2012-07-24 14:54:34 +00:00
|
|
|
|
using MediaBrowser.Model.Plugins;
|
2012-07-12 06:55:27 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.HtmlBrowser
|
|
|
|
|
{
|
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 "Html Library Browser"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void InitInServer()
|
2012-07-12 06:55:27 +00:00
|
|
|
|
{
|
2012-07-13 03:50:50 +00:00
|
|
|
|
var httpServer = Kernel.Instance.HttpServer;
|
|
|
|
|
|
2012-07-20 02:22:44 +00:00
|
|
|
|
/*httpServer.Where(ctx => ctx.LocalPath.IndexOf("/browser/", StringComparison.OrdinalIgnoreCase) != -1).Subscribe(ctx =>
|
2012-07-14 20:45:11 +00:00
|
|
|
|
{
|
|
|
|
|
string localPath = ctx.LocalPath;
|
|
|
|
|
string srch = "/browser/";
|
2012-07-13 03:50:50 +00:00
|
|
|
|
|
2012-07-14 20:45:11 +00:00
|
|
|
|
int index = localPath.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
|
2012-07-13 03:50:50 +00:00
|
|
|
|
|
2012-07-14 20:45:11 +00:00
|
|
|
|
string resource = localPath.Substring(index + srch.Length);
|
|
|
|
|
|
|
|
|
|
ctx.Respond(new EmbeddedResourceHandler(ctx, resource));
|
|
|
|
|
|
2012-07-20 02:22:44 +00:00
|
|
|
|
});*/
|
2012-07-12 06:55:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|