Fix GetPathValue function

This commit is contained in:
Bond-009 2019-11-13 10:11:45 +01:00
parent 0b02c77691
commit b14d6d0417
3 changed files with 8 additions and 12 deletions

View File

@ -7,7 +7,6 @@ using System.Net.Sockets;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Emby.Server.Implementations.Configuration;
using Emby.Server.Implementations.Net;
using Emby.Server.Implementations.Services;
using MediaBrowser.Common.Extensions;
@ -16,7 +15,6 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
using Microsoft.AspNetCore.Http;

View File

@ -40,14 +40,13 @@ namespace MediaBrowser.Api
internal IHttpResultFactory ResultFactory { get; private set; }
/// <summary>
/// The application paths
/// Gets the configuration manager.
/// </summary>
private readonly IServerConfigurationManager _config;
internal IServerConfigurationManager ConfigurationManager { get; }
private readonly ISessionManager _sessionManager;
private readonly IFileSystem _fileSystem;
private readonly IMediaSourceManager _mediaSourceManager;
public readonly IProcessFactory ProcessFactory;
/// <summary>
/// The active transcoding jobs
@ -73,15 +72,13 @@ namespace MediaBrowser.Api
IServerConfigurationManager config,
IFileSystem fileSystem,
IMediaSourceManager mediaSourceManager,
IProcessFactory processFactory,
IHttpResultFactory resultFactory)
{
Logger = logger;
_sessionManager = sessionManager;
_config = config;
ConfigurationManager = config;
_fileSystem = fileSystem;
_mediaSourceManager = mediaSourceManager;
ProcessFactory = processFactory;
ResultFactory = resultFactory;
_sessionManager.PlaybackProgress += _sessionManager_PlaybackProgress;
@ -162,7 +159,7 @@ namespace MediaBrowser.Api
public EncodingOptions GetEncodingOptions()
{
return ConfigurationManagerExtensions.GetConfiguration<EncodingOptions>(_config, "encoding");
return ConfigurationManagerExtensions.GetConfiguration<EncodingOptions>(ConfigurationManager, "encoding");
}
/// <summary>
@ -170,7 +167,7 @@ namespace MediaBrowser.Api
/// </summary>
private void DeleteEncodedMediaCache()
{
var path = _config.ApplicationPaths.GetTranscodingTempPath();
var path = ConfigurationManager.ApplicationPaths.GetTranscodingTempPath();
if (!Directory.Exists(path))
{

View File

@ -299,8 +299,9 @@ namespace MediaBrowser.Api
var first = pathInfo[0];
// backwards compatibility
if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) ||
string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase))
if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase)
|| string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase)
|| string.Equals(first, ApiEntryPoint.Instance.ConfigurationManager.Configuration.BaseUrl))
{
index++;
}