@ -263,7 +263,7 @@ namespace Emby.Server.Implementations
protected virtual IResourceFileManager CreateResourceFileManager ( )
{
return new ResourceFileManager ( HttpResultFactory , LoggerFactory .CreateLogger ( "ResourceManager" ) , FileSystemManager ) ;
return new ResourceFileManager ( HttpResultFactory , LoggerFactory , FileSystemManager ) ;
}
/// <summary>
@ -378,7 +378,7 @@ namespace Emby.Server.Implementations
// hack alert, until common can target .net core
BaseExtensions . CryptographyProvider = CryptographyProvider ;
XmlSerializer = new MyXmlSerializer ( fileSystem , loggerFactory .CreateLogger ( "XmlSerializer" ) );
XmlSerializer = new MyXmlSerializer ( fileSystem , loggerFactory );
NetworkManager = networkManager ;
networkManager . LocalSubnetsFn = GetConfiguredLocalSubnets ;
@ -450,7 +450,7 @@ namespace Emby.Server.Implementations
{
if ( _deviceId = = null )
{
_deviceId = new DeviceId ( ApplicationPaths , LoggerFactory .CreateLogger ( "SystemId" ) , FileSystemManager ) ;
_deviceId = new DeviceId ( ApplicationPaths , LoggerFactory , FileSystemManager ) ;
}
return _deviceId . Value ;
@ -709,11 +709,6 @@ namespace Emby.Server.Implementations
}
}
private IJsonSerializer CreateJsonSerializer ( )
{
return new JsonSerializer ( FileSystemManager , LoggerFactory . CreateLogger ( "JsonSerializer" ) ) ;
}
public void Init ( )
{
HttpPort = ServerConfigurationManager . Configuration . HttpServerPortNumber ;
@ -726,7 +721,7 @@ namespace Emby.Server.Implementations
HttpsPort = ServerConfiguration . DefaultHttpsPort ;
}
JsonSerializer = CreateJsonSerializer ( ) ;
JsonSerializer = new JsonSerializer ( FileSystemManager ) ;
if ( Plugins ! = null )
{
@ -751,7 +746,7 @@ namespace Emby.Server.Implementations
protected virtual IHttpClient CreateHttpClient ( )
{
return new HttpClientManager . HttpClientManager ( ApplicationPaths , LoggerFactory .CreateLogger ( "HttpClient" ) , FileSystemManager , ( ) = > ApplicationUserAgent ) ;
return new HttpClientManager . HttpClientManager ( ApplicationPaths , LoggerFactory , FileSystemManager , ( ) = > ApplicationUserAgent ) ;
}
public static IStreamHelper StreamHelper { get ; set ; }
@ -784,7 +779,7 @@ namespace Emby.Server.Implementations
IsoManager = new IsoManager ( ) ;
RegisterSingleInstance ( IsoManager ) ;
TaskManager = new TaskManager ( ApplicationPaths , JsonSerializer , LoggerFactory .CreateLogger ( "TaskManager" ) , FileSystemManager , SystemEvents ) ;
TaskManager = new TaskManager ( ApplicationPaths , JsonSerializer , LoggerFactory , FileSystemManager , SystemEvents ) ;
RegisterSingleInstance ( TaskManager ) ;
RegisterSingleInstance ( XmlSerializer ) ;
@ -801,10 +796,10 @@ namespace Emby.Server.Implementations
RegisterSingleInstance ( CryptographyProvider ) ;
SocketFactory = new SocketFactory ( LoggerFactory . CreateLogger ( "SocketFactory" ) ) ;
SocketFactory = new SocketFactory ( ) ;
RegisterSingleInstance ( SocketFactory ) ;
InstallationManager = new InstallationManager ( LoggerFactory .CreateLogger ( "InstallationManager" ) , this , ApplicationPaths , HttpClient , JsonSerializer , ServerConfigurationManager , FileSystemManager , CryptographyProvider , PackageRuntime ) ;
InstallationManager = new InstallationManager ( LoggerFactory , this , ApplicationPaths , HttpClient , JsonSerializer , ServerConfigurationManager , FileSystemManager , CryptographyProvider , PackageRuntime ) ;
RegisterSingleInstance ( InstallationManager ) ;
ZipClient = new ZipClient ( FileSystemManager ) ;
@ -821,7 +816,7 @@ namespace Emby.Server.Implementations
IAssemblyInfo assemblyInfo = new AssemblyInfo ( ) ;
RegisterSingleInstance ( assemblyInfo ) ;
LocalizationManager = new LocalizationManager ( ServerConfigurationManager , FileSystemManager , JsonSerializer , LoggerFactory .CreateLogger ( "LocalizationManager" ) , assemblyInfo , new TextLocalizer ( ) ) ;
LocalizationManager = new LocalizationManager ( ServerConfigurationManager , FileSystemManager , JsonSerializer , LoggerFactory , assemblyInfo , new TextLocalizer ( ) ) ;
StringExtensions . LocalizationManager = LocalizationManager ;
RegisterSingleInstance ( LocalizationManager ) ;
@ -837,23 +832,24 @@ namespace Emby.Server.Implementations
// This is only needed for disposal purposes. If removing this, make sure to have the manager handle disposing it
RegisterSingleInstance ( UserRepository ) ;
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository ( LoggerFactory .CreateLogger ( "SqliteDisplayPreferencesRepository" ) , JsonSerializer , ApplicationPaths , FileSystemManager ) ;
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository ( LoggerFactory , JsonSerializer , ApplicationPaths , FileSystemManager ) ;
DisplayPreferencesRepository = displayPreferencesRepo ;
RegisterSingleInstance ( DisplayPreferencesRepository ) ;
var itemRepo = new SqliteItemRepository ( ServerConfigurationManager , this , JsonSerializer , LoggerFactory .CreateLogger ( "SqliteItemRepository" ) , assemblyInfo , FileSystemManager , EnvironmentInfo , TimerFactory ) ;
var itemRepo = new SqliteItemRepository ( ServerConfigurationManager , this , JsonSerializer , LoggerFactory , assemblyInfo , FileSystemManager , EnvironmentInfo , TimerFactory ) ;
ItemRepository = itemRepo ;
RegisterSingleInstance ( ItemRepository ) ;
AuthenticationRepository = GetAuthenticationRepository ( ) ;
RegisterSingleInstance ( AuthenticationRepository ) ;
UserManager = new UserManager ( LoggerFactory .CreateLogger ( "UserManager" ) , ServerConfigurationManager , UserRepository , XmlSerializer , NetworkManager , ( ) = > ImageProcessor , ( ) = > DtoService , this , JsonSerializer , FileSystemManager , CryptographyProvider ) ;
UserManager = new UserManager ( LoggerFactory , ServerConfigurationManager , UserRepository , XmlSerializer , NetworkManager , ( ) = > ImageProcessor , ( ) = > DtoService , this , JsonSerializer , FileSystemManager , CryptographyProvider ) ;
RegisterSingleInstance ( UserManager ) ;
LibraryManager = new LibraryManager ( this , Logger , TaskManager , UserManager , ServerConfigurationManager , UserDataManager , ( ) = > LibraryMonitor , FileSystemManager , ( ) = > ProviderManager , ( ) = > UserViewManager ) ;
LibraryManager = new LibraryManager ( this , Logger Factory , TaskManager , UserManager , ServerConfigurationManager , UserDataManager , ( ) = > LibraryMonitor , FileSystemManager , ( ) = > ProviderManager , ( ) = > UserViewManager ) ;
RegisterSingleInstance ( LibraryManager ) ;
// TODO wtaylor: investigate use of second music manager
var musicManager = new MusicManager ( LibraryManager ) ;
RegisterSingleInstance < IMusicManager > ( new MusicManager ( LibraryManager ) ) ;
@ -866,7 +862,7 @@ namespace Emby.Server.Implementations
Certificate = GetCertificate ( CertificateInfo ) ;
HttpServer = new HttpListenerHost ( this ,
LoggerFactory .CreateLogger ( "HttpServer" ) ,
LoggerFactory ,
ServerConfigurationManager ,
"web/index.html" ,
NetworkManager ,
@ -886,37 +882,37 @@ namespace Emby.Server.Implementations
var encryptionManager = new EncryptionManager ( ) ;
RegisterSingleInstance < IEncryptionManager > ( encryptionManager ) ;
DeviceManager = new DeviceManager ( AuthenticationRepository , JsonSerializer , LibraryManager , LocalizationManager , UserManager , FileSystemManager , LibraryMonitor , ServerConfigurationManager , LoggerFactory .CreateLogger ( "DeviceManager" ) , NetworkManager ) ;
DeviceManager = new DeviceManager ( AuthenticationRepository , JsonSerializer , LibraryManager , LocalizationManager , UserManager , FileSystemManager , LibraryMonitor , ServerConfigurationManager , LoggerFactory , NetworkManager ) ;
RegisterSingleInstance ( DeviceManager ) ;
MediaSourceManager = new MediaSourceManager ( ItemRepository , ApplicationPaths , LocalizationManager , UserManager , LibraryManager , LoggerFactory .CreateLogger ( "MediaSourceManager" ) , JsonSerializer , FileSystemManager , UserDataManager , TimerFactory , ( ) = > MediaEncoder ) ;
MediaSourceManager = new MediaSourceManager ( ItemRepository , ApplicationPaths , LocalizationManager , UserManager , LibraryManager , LoggerFactory , JsonSerializer , FileSystemManager , UserDataManager , TimerFactory , ( ) = > MediaEncoder ) ;
RegisterSingleInstance ( MediaSourceManager ) ;
SubtitleManager = new SubtitleManager ( LoggerFactory .CreateLogger ( "SubtitleManager" ) , FileSystemManager , LibraryMonitor , MediaSourceManager , ServerConfigurationManager , LocalizationManager ) ;
SubtitleManager = new SubtitleManager ( LoggerFactory , FileSystemManager , LibraryMonitor , MediaSourceManager , ServerConfigurationManager , LocalizationManager ) ;
RegisterSingleInstance ( SubtitleManager ) ;
ProviderManager = new ProviderManager ( HttpClient , SubtitleManager , ServerConfigurationManager , LibraryMonitor , LoggerFactory , FileSystemManager , ApplicationPaths , ( ) = > LibraryManager , JsonSerializer ) ;
RegisterSingleInstance ( ProviderManager ) ;
DtoService = new DtoService ( LoggerFactory .CreateLogger ( "DtoService" ) , LibraryManager , UserDataManager , ItemRepository , ImageProcessor , ServerConfigurationManager , FileSystemManager , ProviderManager , ( ) = > ChannelManager , this , ( ) = > DeviceManager , ( ) = > MediaSourceManager , ( ) = > LiveTvManager ) ;
DtoService = new DtoService ( LoggerFactory , LibraryManager , UserDataManager , ItemRepository , ImageProcessor , ServerConfigurationManager , FileSystemManager , ProviderManager , ( ) = > ChannelManager , this , ( ) = > DeviceManager , ( ) = > MediaSourceManager , ( ) = > LiveTvManager ) ;
RegisterSingleInstance ( DtoService ) ;
ChannelManager = new ChannelManager ( UserManager , DtoService , LibraryManager , LoggerFactory .CreateLogger ( "ChannelManager" ) , ServerConfigurationManager , FileSystemManager , UserDataManager , JsonSerializer , LocalizationManager , HttpClient , ProviderManager ) ;
ChannelManager = new ChannelManager ( UserManager , DtoService , LibraryManager , LoggerFactory , ServerConfigurationManager , FileSystemManager , UserDataManager , JsonSerializer , LocalizationManager , HttpClient , ProviderManager ) ;
RegisterSingleInstance ( ChannelManager ) ;
SessionManager = new SessionManager ( UserDataManager , LoggerFactory .CreateLogger ( "SessionManager" ) , LibraryManager , UserManager , musicManager , DtoService , ImageProcessor , JsonSerializer , this , HttpClient , AuthenticationRepository , DeviceManager , MediaSourceManager , TimerFactory ) ;
SessionManager = new SessionManager ( UserDataManager , LoggerFactory , LibraryManager , UserManager , musicManager , DtoService , ImageProcessor , JsonSerializer , this , HttpClient , AuthenticationRepository , DeviceManager , MediaSourceManager , TimerFactory ) ;
RegisterSingleInstance ( SessionManager ) ;
var dlnaManager = new DlnaManager ( XmlSerializer , FileSystemManager , ApplicationPaths , LoggerFactory .CreateLogger ( "Dlna" ) , JsonSerializer , this , assemblyInfo ) ;
var dlnaManager = new DlnaManager ( XmlSerializer , FileSystemManager , ApplicationPaths , LoggerFactory , JsonSerializer , this , assemblyInfo ) ;
RegisterSingleInstance < IDlnaManager > ( dlnaManager ) ;
CollectionManager = new CollectionManager ( LibraryManager , ApplicationPaths , LocalizationManager , FileSystemManager , LibraryMonitor , LoggerFactory .CreateLogger ( "CollectionManager" ) , ProviderManager ) ;
CollectionManager = new CollectionManager ( LibraryManager , ApplicationPaths , LocalizationManager , FileSystemManager , LibraryMonitor , LoggerFactory , ProviderManager ) ;
RegisterSingleInstance ( CollectionManager ) ;
PlaylistManager = new PlaylistManager ( LibraryManager , FileSystemManager , LibraryMonitor , LoggerFactory .CreateLogger ( "PlaylistManager" ) , UserManager , ProviderManager ) ;
PlaylistManager = new PlaylistManager ( LibraryManager , FileSystemManager , LibraryMonitor , LoggerFactory , UserManager , ProviderManager ) ;
RegisterSingleInstance ( PlaylistManager ) ;
LiveTvManager = new LiveTvManager ( this , HttpClient, ServerConfigurationManager, Logger , ItemRepository , ImageProcessor , UserDataManager , DtoService , UserManager , LibraryManager , TaskManager , LocalizationManager , JsonSerializer , ProviderManager , FileSystemManager , ( ) = > ChannelManager ) ;
LiveTvManager = new LiveTvManager ( this , ServerConfigurationManager, Logger Factory , ItemRepository , ImageProcessor , UserDataManager , DtoService , UserManager , LibraryManager , TaskManager , LocalizationManager , JsonSerializer , ProviderManager , FileSystemManager , ( ) = > ChannelManager ) ;
RegisterSingleInstance ( LiveTvManager ) ;
UserViewManager = new UserViewManager ( LibraryManager , LocalizationManager , UserManager , ChannelManager , LiveTvManager , ServerConfigurationManager ) ;
@ -925,19 +921,19 @@ namespace Emby.Server.Implementations
NotificationManager = new NotificationManager ( LoggerFactory , UserManager , ServerConfigurationManager ) ;
RegisterSingleInstance ( NotificationManager ) ;
RegisterSingleInstance < IDeviceDiscovery > ( new DeviceDiscovery ( LoggerFactory .CreateLogger ( "IDeviceDiscovery" ) , ServerConfigurationManager , SocketFactory , TimerFactory ) ) ;
RegisterSingleInstance < IDeviceDiscovery > ( new DeviceDiscovery ( LoggerFactory , ServerConfigurationManager , SocketFactory , TimerFactory ) ) ;
ChapterManager = new ChapterManager ( LibraryManager , LoggerFactory .CreateLogger ( "ChapterManager" ) , ServerConfigurationManager , ItemRepository ) ;
ChapterManager = new ChapterManager ( LibraryManager , LoggerFactory , ServerConfigurationManager , ItemRepository ) ;
RegisterSingleInstance ( ChapterManager ) ;
RegisterMediaEncoder ( assemblyInfo ) ;
EncodingManager = new MediaEncoder . EncodingManager ( FileSystemManager , Logger , MediaEncoder , ChapterManager , LibraryManager ) ;
EncodingManager = new MediaEncoder . EncodingManager ( FileSystemManager , Logger Factory , MediaEncoder , ChapterManager , LibraryManager ) ;
RegisterSingleInstance ( EncodingManager ) ;
var activityLogRepo = GetActivityLogRepository ( ) ;
RegisterSingleInstance ( activityLogRepo ) ;
RegisterSingleInstance < IActivityManager > ( new ActivityManager ( LoggerFactory .CreateLogger ( "ActivityManager" ) , activityLogRepo , UserManager ) ) ;
RegisterSingleInstance < IActivityManager > ( new ActivityManager ( LoggerFactory , activityLogRepo , UserManager ) ) ;
var authContext = new AuthorizationContext ( AuthenticationRepository , UserManager ) ;
RegisterSingleInstance < IAuthorizationContext > ( authContext ) ;
@ -946,14 +942,14 @@ namespace Emby.Server.Implementations
AuthService = new AuthService ( UserManager , authContext , ServerConfigurationManager , SessionManager , NetworkManager ) ;
RegisterSingleInstance ( AuthService ) ;
SubtitleEncoder = new MediaBrowser . MediaEncoding . Subtitles . SubtitleEncoder ( LibraryManager , LoggerFactory .CreateLogger ( "SubtitleEncoder" ) , ApplicationPaths , FileSystemManager , MediaEncoder , JsonSerializer , HttpClient , MediaSourceManager , ProcessFactory ) ;
SubtitleEncoder = new MediaBrowser . MediaEncoding . Subtitles . SubtitleEncoder ( LibraryManager , LoggerFactory , ApplicationPaths , FileSystemManager , MediaEncoder , JsonSerializer , HttpClient , MediaSourceManager , ProcessFactory ) ;
RegisterSingleInstance ( SubtitleEncoder ) ;
RegisterSingleInstance ( CreateResourceFileManager ( ) ) ;
displayPreferencesRepo . Initialize ( ) ;
var userDataRepo = new SqliteUserDataRepository ( LoggerFactory .CreateLogger ( "SqliteUserDataRepository" ) , ApplicationPaths , FileSystemManager ) ;
var userDataRepo = new SqliteUserDataRepository ( LoggerFactory , ApplicationPaths ) ;
SetStaticProperties ( ) ;
@ -1046,7 +1042,7 @@ namespace Emby.Server.Implementations
private IImageProcessor GetImageProcessor ( )
{
return new ImageProcessor ( LoggerFactory .CreateLogger ( "ImageProcessor" ) , ServerConfigurationManager . ApplicationPaths , FileSystemManager , JsonSerializer , ImageEncoder , ( ) = > LibraryManager , TimerFactory , ( ) = > MediaEncoder ) ;
return new ImageProcessor ( LoggerFactory , ServerConfigurationManager . ApplicationPaths , FileSystemManager , JsonSerializer , ImageEncoder , ( ) = > LibraryManager , TimerFactory , ( ) = > MediaEncoder ) ;
}
protected virtual FFMpegInstallInfo GetFfmpegInstallInfo ( )
@ -1105,7 +1101,7 @@ namespace Emby.Server.Implementations
var hasExternalEncoder = string . Equals ( info . Version , "external" , StringComparison . OrdinalIgnoreCase ) ;
var mediaEncoder = new MediaBrowser . MediaEncoding . Encoder . MediaEncoder (
LoggerFactory .CreateLogger ( "MediaEncoder" ) ,
LoggerFactory ,
JsonSerializer ,
encoderPath ,
probePath ,
@ -1134,7 +1130,7 @@ namespace Emby.Server.Implementations
/// <returns>Task{IUserRepository}.</returns>
private IUserRepository GetUserRepository ( )
{
var repo = new SqliteUserRepository ( LoggerFactory .CreateLogger ( "SqliteUserRepository" ) , ApplicationPaths , JsonSerializer ) ;
var repo = new SqliteUserRepository ( LoggerFactory , ApplicationPaths , JsonSerializer ) ;
repo . Initialize ( ) ;
@ -1143,7 +1139,7 @@ namespace Emby.Server.Implementations
private IAuthenticationRepository GetAuthenticationRepository ( )
{
var repo = new AuthenticationRepository ( LoggerFactory .CreateLogger ( "AuthenticationRepository" ) , ServerConfigurationManager ) ;
var repo = new AuthenticationRepository ( LoggerFactory , ServerConfigurationManager ) ;
repo . Initialize ( ) ;
@ -1152,7 +1148,7 @@ namespace Emby.Server.Implementations
private IActivityRepository GetActivityLogRepository ( )
{
var repo = new ActivityRepository ( LoggerFactory .CreateLogger ( "ActivityRepository" ) , ServerConfigurationManager . ApplicationPaths , FileSystemManager ) ;
var repo = new ActivityRepository ( LoggerFactory , ServerConfigurationManager . ApplicationPaths , FileSystemManager ) ;
repo . Initialize ( ) ;