diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/ServerApplicationPaths.cs | 6 |
2 files changed, 8 insertions, 8 deletions
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 /// <returns>System.Object.</returns> 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 /// <summary> /// Initializes a new instance of the <see cref="BaseApplicationPaths" /> class. /// </summary> - 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; } + /// <summary> /// Gets the path to the base root media directory /// </summary> |
