From 63a0d52fd115f3a4888acd53f9fd92defa9dc721 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 26 Nov 2014 15:57:16 -0500 Subject: allow separate configuration of app resources path --- .../HttpServer/SwaggerService.cs | 10 ++++------ MediaBrowser.Server.Implementations/ServerApplicationPaths.cs | 6 ++++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Server.Implementations') diff --git a/MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs b/MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs index 3764697f1e..aeaac80e88 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Configuration; +using MediaBrowser.Controller; using MediaBrowser.Controller.Net; using ServiceStack.Web; using System.IO; @@ -7,9 +7,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer { public class SwaggerService : IHasResultFactory, IRestfulService { - private readonly IApplicationPaths _appPaths; + private readonly IServerApplicationPaths _appPaths; - public SwaggerService(IApplicationPaths appPaths) + public SwaggerService(IServerApplicationPaths appPaths) { _appPaths = appPaths; } @@ -21,9 +21,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer /// System.Object. public object Get(GetSwaggerResource request) { - var runningDirectory = Path.GetDirectoryName(_appPaths.ApplicationPath); - - var swaggerDirectory = Path.Combine(runningDirectory, "swagger-ui"); + var swaggerDirectory = Path.Combine(_appPaths.ApplicationResourcesPath, "swagger-ui"); var requestedFile = Path.Combine(swaggerDirectory, request.ResourceName.Replace('/', Path.DirectorySeparatorChar)); diff --git a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs b/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs index 68956be183..d9973afe78 100644 --- a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs +++ b/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs @@ -12,12 +12,14 @@ namespace MediaBrowser.Server.Implementations /// /// Initializes a new instance of the class. /// - public ServerApplicationPaths(string programDataPath, string applicationPath) + public ServerApplicationPaths(string programDataPath, string applicationPath, string applicationResourcesPath) : base(programDataPath, applicationPath) { - + ApplicationResourcesPath = applicationResourcesPath; } + public string ApplicationResourcesPath { get; private set; } + /// /// Gets the path to the base root media directory /// -- cgit v1.2.3