Merge pull request #10331 from barronpm/minor-cleanup
This commit is contained in:
commit
c124d02501
|
@ -8,7 +8,6 @@ using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Common.Events;
|
using MediaBrowser.Common.Events;
|
||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.IO;
|
|
||||||
using MediaBrowser.Model.Serialization;
|
using MediaBrowser.Model.Serialization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
@ -19,14 +18,8 @@ namespace Emby.Server.Implementations.AppBase
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseConfigurationManager : IConfigurationManager
|
public abstract class BaseConfigurationManager : IConfigurationManager
|
||||||
{
|
{
|
||||||
private readonly IFileSystem _fileSystem;
|
private readonly ConcurrentDictionary<string, object> _configurations = new();
|
||||||
|
private readonly object _configurationSyncLock = new();
|
||||||
private readonly ConcurrentDictionary<string, object> _configurations = new ConcurrentDictionary<string, object>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The _configuration sync lock.
|
|
||||||
/// </summary>
|
|
||||||
private readonly object _configurationSyncLock = new object();
|
|
||||||
|
|
||||||
private ConfigurationStore[] _configurationStores = Array.Empty<ConfigurationStore>();
|
private ConfigurationStore[] _configurationStores = Array.Empty<ConfigurationStore>();
|
||||||
private IConfigurationFactory[] _configurationFactories = Array.Empty<IConfigurationFactory>();
|
private IConfigurationFactory[] _configurationFactories = Array.Empty<IConfigurationFactory>();
|
||||||
|
@ -42,12 +35,13 @@ namespace Emby.Server.Implementations.AppBase
|
||||||
/// <param name="applicationPaths">The application paths.</param>
|
/// <param name="applicationPaths">The application paths.</param>
|
||||||
/// <param name="loggerFactory">The logger factory.</param>
|
/// <param name="loggerFactory">The logger factory.</param>
|
||||||
/// <param name="xmlSerializer">The XML serializer.</param>
|
/// <param name="xmlSerializer">The XML serializer.</param>
|
||||||
/// <param name="fileSystem">The file system.</param>
|
protected BaseConfigurationManager(
|
||||||
protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
IApplicationPaths applicationPaths,
|
||||||
|
ILoggerFactory loggerFactory,
|
||||||
|
IXmlSerializer xmlSerializer)
|
||||||
{
|
{
|
||||||
CommonApplicationPaths = applicationPaths;
|
CommonApplicationPaths = applicationPaths;
|
||||||
XmlSerializer = xmlSerializer;
|
XmlSerializer = xmlSerializer;
|
||||||
_fileSystem = fileSystem;
|
|
||||||
Logger = loggerFactory.CreateLogger<BaseConfigurationManager>();
|
Logger = loggerFactory.CreateLogger<BaseConfigurationManager>();
|
||||||
|
|
||||||
UpdateCachePath();
|
UpdateCachePath();
|
||||||
|
@ -272,7 +266,7 @@ namespace Emby.Server.Implementations.AppBase
|
||||||
{
|
{
|
||||||
var file = Path.Combine(path, Guid.NewGuid().ToString());
|
var file = Path.Combine(path, Guid.NewGuid().ToString());
|
||||||
File.WriteAllText(file, string.Empty);
|
File.WriteAllText(file, string.Empty);
|
||||||
_fileSystem.DeleteFile(file);
|
File.Delete(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetConfigurationFile(string key)
|
private string GetConfigurationFile(string key)
|
||||||
|
|
|
@ -120,7 +120,6 @@ namespace Emby.Server.Implementations
|
||||||
private readonly ConcurrentDictionary<IDisposable, byte> _disposableParts = new();
|
private readonly ConcurrentDictionary<IDisposable, byte> _disposableParts = new();
|
||||||
private readonly DeviceId _deviceId;
|
private readonly DeviceId _deviceId;
|
||||||
|
|
||||||
private readonly IFileSystem _fileSystemManager;
|
|
||||||
private readonly IConfiguration _startupConfig;
|
private readonly IConfiguration _startupConfig;
|
||||||
private readonly IXmlSerializer _xmlSerializer;
|
private readonly IXmlSerializer _xmlSerializer;
|
||||||
private readonly IStartupOptions _startupOptions;
|
private readonly IStartupOptions _startupOptions;
|
||||||
|
@ -153,10 +152,8 @@ namespace Emby.Server.Implementations
|
||||||
LoggerFactory = loggerFactory;
|
LoggerFactory = loggerFactory;
|
||||||
_startupOptions = options;
|
_startupOptions = options;
|
||||||
_startupConfig = startupConfig;
|
_startupConfig = startupConfig;
|
||||||
_fileSystemManager = new ManagedFileSystem(LoggerFactory.CreateLogger<ManagedFileSystem>(), applicationPaths);
|
|
||||||
|
|
||||||
Logger = LoggerFactory.CreateLogger<ApplicationHost>();
|
Logger = LoggerFactory.CreateLogger<ApplicationHost>();
|
||||||
_fileSystemManager.AddShortcutHandler(new MbLinkShortcutHandler());
|
|
||||||
_deviceId = new DeviceId(ApplicationPaths, LoggerFactory);
|
_deviceId = new DeviceId(ApplicationPaths, LoggerFactory);
|
||||||
|
|
||||||
ApplicationVersion = typeof(ApplicationHost).Assembly.GetName().Version;
|
ApplicationVersion = typeof(ApplicationHost).Assembly.GetName().Version;
|
||||||
|
@ -164,7 +161,7 @@ namespace Emby.Server.Implementations
|
||||||
ApplicationUserAgent = Name.Replace(' ', '-') + "/" + ApplicationVersionString;
|
ApplicationUserAgent = Name.Replace(' ', '-') + "/" + ApplicationVersionString;
|
||||||
|
|
||||||
_xmlSerializer = new MyXmlSerializer();
|
_xmlSerializer = new MyXmlSerializer();
|
||||||
ConfigurationManager = new ServerConfigurationManager(ApplicationPaths, LoggerFactory, _xmlSerializer, _fileSystemManager);
|
ConfigurationManager = new ServerConfigurationManager(ApplicationPaths, LoggerFactory, _xmlSerializer);
|
||||||
_pluginManager = new PluginManager(
|
_pluginManager = new PluginManager(
|
||||||
LoggerFactory.CreateLogger<PluginManager>(),
|
LoggerFactory.CreateLogger<PluginManager>(),
|
||||||
this,
|
this,
|
||||||
|
@ -507,7 +504,9 @@ namespace Emby.Server.Implementations
|
||||||
serviceCollection.AddSingleton(_pluginManager);
|
serviceCollection.AddSingleton(_pluginManager);
|
||||||
serviceCollection.AddSingleton<IApplicationPaths>(ApplicationPaths);
|
serviceCollection.AddSingleton<IApplicationPaths>(ApplicationPaths);
|
||||||
|
|
||||||
serviceCollection.AddSingleton(_fileSystemManager);
|
serviceCollection.AddSingleton<IFileSystem, ManagedFileSystem>();
|
||||||
|
serviceCollection.AddSingleton<IShortcutHandler, MbLinkShortcutHandler>();
|
||||||
|
|
||||||
serviceCollection.AddSingleton<TmdbClientManager>();
|
serviceCollection.AddSingleton<TmdbClientManager>();
|
||||||
|
|
||||||
serviceCollection.AddSingleton(NetManager);
|
serviceCollection.AddSingleton(NetManager);
|
||||||
|
@ -681,7 +680,7 @@ namespace Emby.Server.Implementations
|
||||||
BaseItem.ProviderManager = Resolve<IProviderManager>();
|
BaseItem.ProviderManager = Resolve<IProviderManager>();
|
||||||
BaseItem.LocalizationManager = Resolve<ILocalizationManager>();
|
BaseItem.LocalizationManager = Resolve<ILocalizationManager>();
|
||||||
BaseItem.ItemRepository = Resolve<IItemRepository>();
|
BaseItem.ItemRepository = Resolve<IItemRepository>();
|
||||||
BaseItem.FileSystem = _fileSystemManager;
|
BaseItem.FileSystem = Resolve<IFileSystem>();
|
||||||
BaseItem.UserDataManager = Resolve<IUserDataManager>();
|
BaseItem.UserDataManager = Resolve<IUserDataManager>();
|
||||||
BaseItem.ChannelManager = Resolve<IChannelManager>();
|
BaseItem.ChannelManager = Resolve<IChannelManager>();
|
||||||
Video.LiveTvManager = Resolve<ILiveTvManager>();
|
Video.LiveTvManager = Resolve<ILiveTvManager>();
|
||||||
|
|
|
@ -7,7 +7,6 @@ using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Controller;
|
using MediaBrowser.Controller;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.IO;
|
|
||||||
using MediaBrowser.Model.Serialization;
|
using MediaBrowser.Model.Serialization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
@ -22,11 +21,13 @@ namespace Emby.Server.Implementations.Configuration
|
||||||
/// Initializes a new instance of the <see cref="ServerConfigurationManager" /> class.
|
/// Initializes a new instance of the <see cref="ServerConfigurationManager" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="applicationPaths">The application paths.</param>
|
/// <param name="applicationPaths">The application paths.</param>
|
||||||
/// <param name="loggerFactory">The paramref name="loggerFactory" factory.</param>
|
/// <param name="loggerFactory">The logger factory.</param>
|
||||||
/// <param name="xmlSerializer">The XML serializer.</param>
|
/// <param name="xmlSerializer">The XML serializer.</param>
|
||||||
/// <param name="fileSystem">The file system.</param>
|
public ServerConfigurationManager(
|
||||||
public ServerConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
IApplicationPaths applicationPaths,
|
||||||
: base(applicationPaths, loggerFactory, xmlSerializer, fileSystem)
|
ILoggerFactory loggerFactory,
|
||||||
|
IXmlSerializer xmlSerializer)
|
||||||
|
: base(applicationPaths, loggerFactory, xmlSerializer)
|
||||||
{
|
{
|
||||||
UpdateMetadataPath();
|
UpdateMetadataPath();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,6 @@ namespace Emby.Server.Implementations.IO
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ManagedFileSystem : IFileSystem
|
public class ManagedFileSystem : IFileSystem
|
||||||
{
|
{
|
||||||
private readonly ILogger<ManagedFileSystem> _logger;
|
|
||||||
|
|
||||||
private readonly List<IShortcutHandler> _shortcutHandlers = new List<IShortcutHandler>();
|
|
||||||
private readonly string _tempPath;
|
|
||||||
private static readonly bool _isEnvironmentCaseInsensitive = OperatingSystem.IsWindows();
|
private static readonly bool _isEnvironmentCaseInsensitive = OperatingSystem.IsWindows();
|
||||||
private static readonly char[] _invalidPathCharacters =
|
private static readonly char[] _invalidPathCharacters =
|
||||||
{
|
{
|
||||||
|
@ -29,23 +25,24 @@ namespace Emby.Server.Implementations.IO
|
||||||
(char)31, ':', '*', '?', '\\', '/'
|
(char)31, ':', '*', '?', '\\', '/'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private readonly ILogger<ManagedFileSystem> _logger;
|
||||||
|
private readonly List<IShortcutHandler> _shortcutHandlers;
|
||||||
|
private readonly string _tempPath;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ManagedFileSystem"/> class.
|
/// Initializes a new instance of the <see cref="ManagedFileSystem"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="logger">The <see cref="ILogger"/> instance to use.</param>
|
/// <param name="logger">The <see cref="ILogger"/> instance to use.</param>
|
||||||
/// <param name="applicationPaths">The <see cref="IApplicationPaths"/> instance to use.</param>
|
/// <param name="applicationPaths">The <see cref="IApplicationPaths"/> instance to use.</param>
|
||||||
|
/// <param name="shortcutHandlers">the <see cref="IShortcutHandler"/>'s to use.</param>
|
||||||
public ManagedFileSystem(
|
public ManagedFileSystem(
|
||||||
ILogger<ManagedFileSystem> logger,
|
ILogger<ManagedFileSystem> logger,
|
||||||
IApplicationPaths applicationPaths)
|
IApplicationPaths applicationPaths,
|
||||||
|
IEnumerable<IShortcutHandler> shortcutHandlers)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_tempPath = applicationPaths.TempDirectory;
|
_tempPath = applicationPaths.TempDirectory;
|
||||||
}
|
_shortcutHandlers = shortcutHandlers.ToList();
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public virtual void AddShortcutHandler(IShortcutHandler handler)
|
|
||||||
{
|
|
||||||
_shortcutHandlers.Add(handler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -951,28 +951,28 @@ namespace Emby.Server.Implementations.Session
|
||||||
|
|
||||||
private bool OnPlaybackStopped(User user, BaseItem item, long? positionTicks, bool playbackFailed)
|
private bool OnPlaybackStopped(User user, BaseItem item, long? positionTicks, bool playbackFailed)
|
||||||
{
|
{
|
||||||
bool playedToCompletion = false;
|
if (playbackFailed)
|
||||||
|
|
||||||
if (!playbackFailed)
|
|
||||||
{
|
{
|
||||||
var data = _userDataManager.GetUserData(user, item);
|
return false;
|
||||||
|
|
||||||
if (positionTicks.HasValue)
|
|
||||||
{
|
|
||||||
playedToCompletion = _userDataManager.UpdatePlayState(item, data, positionTicks.Value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// If the client isn't able to report this, then we'll just have to make an assumption
|
|
||||||
data.PlayCount++;
|
|
||||||
data.Played = item.SupportsPlayedStatus;
|
|
||||||
data.PlaybackPositionTicks = 0;
|
|
||||||
playedToCompletion = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_userDataManager.SaveUserData(user, item, data, UserDataSaveReason.PlaybackFinished, CancellationToken.None);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var data = _userDataManager.GetUserData(user, item);
|
||||||
|
bool playedToCompletion;
|
||||||
|
if (positionTicks.HasValue)
|
||||||
|
{
|
||||||
|
playedToCompletion = _userDataManager.UpdatePlayState(item, data, positionTicks.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If the client isn't able to report this, then we'll just have to make an assumption
|
||||||
|
data.PlayCount++;
|
||||||
|
data.Played = item.SupportsPlayedStatus;
|
||||||
|
data.PlaybackPositionTicks = 0;
|
||||||
|
playedToCompletion = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
_userDataManager.SaveUserData(user, item, data, UserDataSaveReason.PlaybackFinished, CancellationToken.None);
|
||||||
|
|
||||||
return playedToCompletion;
|
return playedToCompletion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.TV;
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.LiveTv;
|
using MediaBrowser.Controller.LiveTv;
|
||||||
using MediaBrowser.Controller.Session;
|
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.LiveTv;
|
using MediaBrowser.Model.LiveTv;
|
||||||
|
@ -48,7 +47,6 @@ public class LiveTvController : BaseJellyfinApiController
|
||||||
private readonly IMediaSourceManager _mediaSourceManager;
|
private readonly IMediaSourceManager _mediaSourceManager;
|
||||||
private readonly IConfigurationManager _configurationManager;
|
private readonly IConfigurationManager _configurationManager;
|
||||||
private readonly TranscodingJobHelper _transcodingJobHelper;
|
private readonly TranscodingJobHelper _transcodingJobHelper;
|
||||||
private readonly ISessionManager _sessionManager;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="LiveTvController"/> class.
|
/// Initializes a new instance of the <see cref="LiveTvController"/> class.
|
||||||
|
@ -61,7 +59,6 @@ public class LiveTvController : BaseJellyfinApiController
|
||||||
/// <param name="mediaSourceManager">Instance of the <see cref="IMediaSourceManager"/> interface.</param>
|
/// <param name="mediaSourceManager">Instance of the <see cref="IMediaSourceManager"/> interface.</param>
|
||||||
/// <param name="configurationManager">Instance of the <see cref="IConfigurationManager"/> interface.</param>
|
/// <param name="configurationManager">Instance of the <see cref="IConfigurationManager"/> interface.</param>
|
||||||
/// <param name="transcodingJobHelper">Instance of the <see cref="TranscodingJobHelper"/> class.</param>
|
/// <param name="transcodingJobHelper">Instance of the <see cref="TranscodingJobHelper"/> class.</param>
|
||||||
/// <param name="sessionManager">Instance of the <see cref="ISessionManager"/> interface.</param>
|
|
||||||
public LiveTvController(
|
public LiveTvController(
|
||||||
ILiveTvManager liveTvManager,
|
ILiveTvManager liveTvManager,
|
||||||
IUserManager userManager,
|
IUserManager userManager,
|
||||||
|
@ -70,8 +67,7 @@ public class LiveTvController : BaseJellyfinApiController
|
||||||
IDtoService dtoService,
|
IDtoService dtoService,
|
||||||
IMediaSourceManager mediaSourceManager,
|
IMediaSourceManager mediaSourceManager,
|
||||||
IConfigurationManager configurationManager,
|
IConfigurationManager configurationManager,
|
||||||
TranscodingJobHelper transcodingJobHelper,
|
TranscodingJobHelper transcodingJobHelper)
|
||||||
ISessionManager sessionManager)
|
|
||||||
{
|
{
|
||||||
_liveTvManager = liveTvManager;
|
_liveTvManager = liveTvManager;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
|
@ -81,7 +77,6 @@ public class LiveTvController : BaseJellyfinApiController
|
||||||
_mediaSourceManager = mediaSourceManager;
|
_mediaSourceManager = mediaSourceManager;
|
||||||
_configurationManager = configurationManager;
|
_configurationManager = configurationManager;
|
||||||
_transcodingJobHelper = transcodingJobHelper;
|
_transcodingJobHelper = transcodingJobHelper;
|
||||||
_sessionManager = sessionManager;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -33,8 +33,7 @@ public class RobotsRedirectionMiddleware
|
||||||
/// <returns>The async task.</returns>
|
/// <returns>The async task.</returns>
|
||||||
public async Task Invoke(HttpContext httpContext)
|
public async Task Invoke(HttpContext httpContext)
|
||||||
{
|
{
|
||||||
var localPath = httpContext.Request.Path.ToString();
|
if (httpContext.Request.Path.Equals("/robots.txt", StringComparison.OrdinalIgnoreCase))
|
||||||
if (string.Equals(localPath, "/robots.txt", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Redirecting robots.txt request to web/robots.txt");
|
_logger.LogDebug("Redirecting robots.txt request to web/robots.txt");
|
||||||
httpContext.Response.Redirect("web/robots.txt");
|
httpContext.Response.Redirect("web/robots.txt");
|
||||||
|
|
|
@ -20,7 +20,6 @@ using MediaBrowser.Controller.Events;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Net;
|
using MediaBrowser.Controller.Net;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Cryptography;
|
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Users;
|
using MediaBrowser.Model.Users;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
@ -35,7 +34,6 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
{
|
{
|
||||||
private readonly IDbContextFactory<JellyfinDbContext> _dbProvider;
|
private readonly IDbContextFactory<JellyfinDbContext> _dbProvider;
|
||||||
private readonly IEventManager _eventManager;
|
private readonly IEventManager _eventManager;
|
||||||
private readonly ICryptoProvider _cryptoProvider;
|
|
||||||
private readonly INetworkManager _networkManager;
|
private readonly INetworkManager _networkManager;
|
||||||
private readonly IApplicationHost _appHost;
|
private readonly IApplicationHost _appHost;
|
||||||
private readonly IImageProcessor _imageProcessor;
|
private readonly IImageProcessor _imageProcessor;
|
||||||
|
@ -53,7 +51,6 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dbProvider">The database provider.</param>
|
/// <param name="dbProvider">The database provider.</param>
|
||||||
/// <param name="eventManager">The event manager.</param>
|
/// <param name="eventManager">The event manager.</param>
|
||||||
/// <param name="cryptoProvider">The cryptography provider.</param>
|
|
||||||
/// <param name="networkManager">The network manager.</param>
|
/// <param name="networkManager">The network manager.</param>
|
||||||
/// <param name="appHost">The application host.</param>
|
/// <param name="appHost">The application host.</param>
|
||||||
/// <param name="imageProcessor">The image processor.</param>
|
/// <param name="imageProcessor">The image processor.</param>
|
||||||
|
@ -61,7 +58,6 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
public UserManager(
|
public UserManager(
|
||||||
IDbContextFactory<JellyfinDbContext> dbProvider,
|
IDbContextFactory<JellyfinDbContext> dbProvider,
|
||||||
IEventManager eventManager,
|
IEventManager eventManager,
|
||||||
ICryptoProvider cryptoProvider,
|
|
||||||
INetworkManager networkManager,
|
INetworkManager networkManager,
|
||||||
IApplicationHost appHost,
|
IApplicationHost appHost,
|
||||||
IImageProcessor imageProcessor,
|
IImageProcessor imageProcessor,
|
||||||
|
@ -69,7 +65,6 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
{
|
{
|
||||||
_dbProvider = dbProvider;
|
_dbProvider = dbProvider;
|
||||||
_eventManager = eventManager;
|
_eventManager = eventManager;
|
||||||
_cryptoProvider = cryptoProvider;
|
|
||||||
_networkManager = networkManager;
|
_networkManager = networkManager;
|
||||||
_appHost = appHost;
|
_appHost = appHost;
|
||||||
_imageProcessor = imageProcessor;
|
_imageProcessor = imageProcessor;
|
||||||
|
@ -384,7 +379,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
}
|
}
|
||||||
|
|
||||||
var user = Users.FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
var user = Users.FirstOrDefault(i => string.Equals(username, i.Username, StringComparison.OrdinalIgnoreCase));
|
||||||
var authResult = await AuthenticateLocalUser(username, password, user, remoteEndPoint)
|
var authResult = await AuthenticateLocalUser(username, password, user)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
var authenticationProvider = authResult.AuthenticationProvider;
|
var authenticationProvider = authResult.AuthenticationProvider;
|
||||||
var success = authResult.Success;
|
var success = authResult.Success;
|
||||||
|
@ -787,8 +782,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
private async Task<(IAuthenticationProvider? AuthenticationProvider, string Username, bool Success)> AuthenticateLocalUser(
|
private async Task<(IAuthenticationProvider? AuthenticationProvider, string Username, bool Success)> AuthenticateLocalUser(
|
||||||
string username,
|
string username,
|
||||||
string password,
|
string password,
|
||||||
User? user,
|
User? user)
|
||||||
string remoteEndPoint)
|
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
IAuthenticationProvider? authenticationProvider = null;
|
IAuthenticationProvider? authenticationProvider = null;
|
||||||
|
|
|
@ -10,8 +10,6 @@ namespace MediaBrowser.Model.IO
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IFileSystem
|
public interface IFileSystem
|
||||||
{
|
{
|
||||||
void AddShortcutHandler(IShortcutHandler handler);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the specified filename is shortcut.
|
/// Determines whether the specified filename is shortcut.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user