2014-07-04 02:22:57 +00:00
|
|
|
|
using MediaBrowser.Common.Configuration;
|
|
|
|
|
using MediaBrowser.Model.Branding;
|
2016-10-25 19:02:04 +00:00
|
|
|
|
using MediaBrowser.Model.Services;
|
2014-07-04 02:22:57 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Api
|
|
|
|
|
{
|
|
|
|
|
[Route("/Branding/Configuration", "GET", Summary = "Gets branding configuration")]
|
|
|
|
|
public class GetBrandingOptions : IReturn<BrandingOptions>
|
|
|
|
|
{
|
|
|
|
|
}
|
2015-01-19 05:41:56 +00:00
|
|
|
|
|
|
|
|
|
[Route("/Branding/Css", "GET", Summary = "Gets custom css")]
|
2016-04-18 18:01:50 +00:00
|
|
|
|
[Route("/Branding/Css.css", "GET", Summary = "Gets custom css")]
|
2015-01-19 05:41:56 +00:00
|
|
|
|
public class GetBrandingCss
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-04 02:22:57 +00:00
|
|
|
|
public class BrandingService : BaseApiService
|
|
|
|
|
{
|
|
|
|
|
private readonly IConfigurationManager _config;
|
|
|
|
|
|
|
|
|
|
public BrandingService(IConfigurationManager config)
|
|
|
|
|
{
|
|
|
|
|
_config = config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object Get(GetBrandingOptions request)
|
|
|
|
|
{
|
|
|
|
|
var result = _config.GetConfiguration<BrandingOptions>("branding");
|
|
|
|
|
|
|
|
|
|
return ToOptimizedResult(result);
|
|
|
|
|
}
|
2015-01-19 05:41:56 +00:00
|
|
|
|
|
|
|
|
|
public object Get(GetBrandingCss request)
|
|
|
|
|
{
|
|
|
|
|
var result = _config.GetConfiguration<BrandingOptions>("branding");
|
|
|
|
|
|
2015-06-07 19:12:55 +00:00
|
|
|
|
// When null this throws a 405 error under Mono OSX, so default to empty string
|
|
|
|
|
return ResultFactory.GetResult(result.CustomCss ?? string.Empty, "text/css");
|
2015-01-19 05:41:56 +00:00
|
|
|
|
}
|
2014-07-04 02:22:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|