mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 14:58:36 +01:00
Replaced injections of ILogger with ILoggerFactory
This makes resolving dependencies from the container much easier as you cannot resolve with primitives parameters in a way that is any more readable. The aim of this commit is to change as little as possible with the end result, loggers that were newed up for the parent object were given the same name. Objects that used the base or app loggers, were given a new logger with an appropriate name. Also removed some unused dependencies.
This commit is contained in:
@@ -20,8 +20,8 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
protected IFileSystem FileSystem { get; private set; }
|
||||
|
||||
public SqliteDisplayPreferencesRepository(ILogger logger, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, IFileSystem fileSystem)
|
||||
: base(logger)
|
||||
public SqliteDisplayPreferencesRepository(ILoggerFactory loggerFactory, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, IFileSystem fileSystem)
|
||||
: base(loggerFactory.CreateLogger(nameof(SqliteDisplayPreferencesRepository)))
|
||||
{
|
||||
_jsonSerializer = jsonSerializer;
|
||||
FileSystem = fileSystem;
|
||||
|
||||
@@ -67,8 +67,16 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
||||
/// </summary>
|
||||
public SqliteItemRepository(IServerConfigurationManager config, IServerApplicationHost appHost, IJsonSerializer jsonSerializer, ILogger logger, IAssemblyInfo assemblyInfo, IFileSystem fileSystem, IEnvironmentInfo environmentInfo, ITimerFactory timerFactory)
|
||||
: base(logger)
|
||||
public SqliteItemRepository(
|
||||
IServerConfigurationManager config,
|
||||
IServerApplicationHost appHost,
|
||||
IJsonSerializer jsonSerializer,
|
||||
ILoggerFactory loggerFactory,
|
||||
IAssemblyInfo assemblyInfo,
|
||||
IFileSystem fileSystem,
|
||||
IEnvironmentInfo environmentInfo,
|
||||
ITimerFactory timerFactory)
|
||||
: base(loggerFactory.CreateLogger(nameof(SqliteItemRepository)))
|
||||
{
|
||||
if (config == null)
|
||||
{
|
||||
|
||||
@@ -15,12 +15,11 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
public class SqliteUserDataRepository : BaseSqliteRepository, IUserDataRepository
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public SqliteUserDataRepository(ILogger logger, IApplicationPaths appPaths, IFileSystem fileSystem)
|
||||
: base(logger)
|
||||
public SqliteUserDataRepository(
|
||||
ILoggerFactory loggerFactory,
|
||||
IApplicationPaths appPaths)
|
||||
: base(loggerFactory.CreateLogger(nameof(SqliteUserDataRepository)))
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
DbFilePath = Path.Combine(appPaths.DataPath, "library.db");
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,11 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
|
||||
public SqliteUserRepository(ILogger logger, IServerApplicationPaths appPaths, IJsonSerializer jsonSerializer)
|
||||
: base(logger)
|
||||
public SqliteUserRepository(
|
||||
ILoggerFactory loggerFactory,
|
||||
IServerApplicationPaths appPaths,
|
||||
IJsonSerializer jsonSerializer)
|
||||
: base(loggerFactory.CreateLogger(nameof(SqliteUserRepository)))
|
||||
{
|
||||
_jsonSerializer = jsonSerializer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user