mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Convert MediaEncoder property to field
This commit is contained in:
parent
fe9f4e06d1
commit
84b48eb69c
@ -121,6 +121,7 @@ namespace Emby.Server.Implementations
|
|||||||
{
|
{
|
||||||
private SqliteUserRepository _userRepository;
|
private SqliteUserRepository _userRepository;
|
||||||
private SqliteDisplayPreferencesRepository _displayPreferencesRepository;
|
private SqliteDisplayPreferencesRepository _displayPreferencesRepository;
|
||||||
|
private IMediaEncoder _mediaEncoder;
|
||||||
private ISessionManager _sessionManager;
|
private ISessionManager _sessionManager;
|
||||||
private IHttpServer _httpServer;
|
private IHttpServer _httpServer;
|
||||||
|
|
||||||
@ -251,12 +252,6 @@ namespace Emby.Server.Implementations
|
|||||||
/// <value>The user manager.</value>
|
/// <value>The user manager.</value>
|
||||||
public IUserManager UserManager { get; set; }
|
public IUserManager UserManager { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the media encoder.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The media encoder.</value>
|
|
||||||
private IMediaEncoder MediaEncoder { get; set; }
|
|
||||||
|
|
||||||
public LocalizationManager LocalizationManager { get; set; }
|
public LocalizationManager LocalizationManager { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -486,7 +481,7 @@ namespace Emby.Server.Implementations
|
|||||||
|
|
||||||
ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
|
ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
|
||||||
|
|
||||||
MediaEncoder.SetFFmpegPath();
|
_mediaEncoder.SetFFmpegPath();
|
||||||
|
|
||||||
Logger.LogInformation("ServerId: {0}", SystemId);
|
Logger.LogInformation("ServerId: {0}", SystemId);
|
||||||
|
|
||||||
@ -685,7 +680,8 @@ namespace Emby.Server.Implementations
|
|||||||
|
|
||||||
serviceCollection.AddSingleton(UserManager);
|
serviceCollection.AddSingleton(UserManager);
|
||||||
|
|
||||||
MediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
// TODO: Add StartupOptions.FFmpegPath to IConfiguration so this doesn't need to be constructed manually
|
||||||
|
serviceCollection.AddSingleton<IMediaEncoder>(new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
||||||
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(),
|
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(),
|
||||||
ServerConfigurationManager,
|
ServerConfigurationManager,
|
||||||
FileSystemManager,
|
FileSystemManager,
|
||||||
@ -693,8 +689,7 @@ namespace Emby.Server.Implementations
|
|||||||
LocalizationManager,
|
LocalizationManager,
|
||||||
Resolve<ISubtitleEncoder>,
|
Resolve<ISubtitleEncoder>,
|
||||||
startupConfig,
|
startupConfig,
|
||||||
StartupOptions.FFmpegPath);
|
StartupOptions.FFmpegPath));
|
||||||
serviceCollection.AddSingleton(MediaEncoder);
|
|
||||||
|
|
||||||
// TODO: Refactor to eliminate the circular dependencies here so that Lazy<T> isn't required
|
// TODO: Refactor to eliminate the circular dependencies here so that Lazy<T> isn't required
|
||||||
serviceCollection.AddTransient(provider => new Lazy<ILibraryMonitor>(provider.GetRequiredService<ILibraryMonitor>));
|
serviceCollection.AddTransient(provider => new Lazy<ILibraryMonitor>(provider.GetRequiredService<ILibraryMonitor>));
|
||||||
@ -772,6 +767,7 @@ namespace Emby.Server.Implementations
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void InitializeServices()
|
public void InitializeServices()
|
||||||
{
|
{
|
||||||
|
_mediaEncoder = Resolve<IMediaEncoder>();
|
||||||
_sessionManager = Resolve<ISessionManager>();
|
_sessionManager = Resolve<ISessionManager>();
|
||||||
_httpServer = Resolve<IHttpServer>();
|
_httpServer = Resolve<IHttpServer>();
|
||||||
|
|
||||||
@ -1306,7 +1302,7 @@ namespace Emby.Server.Implementations
|
|||||||
ServerName = FriendlyName,
|
ServerName = FriendlyName,
|
||||||
LocalAddress = localAddress,
|
LocalAddress = localAddress,
|
||||||
SupportsLibraryMonitor = true,
|
SupportsLibraryMonitor = true,
|
||||||
EncoderLocation = MediaEncoder.EncoderLocation,
|
EncoderLocation = _mediaEncoder.EncoderLocation,
|
||||||
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
||||||
SystemUpdateLevel = SystemUpdateLevel,
|
SystemUpdateLevel = SystemUpdateLevel,
|
||||||
PackageName = StartupOptions.PackageName
|
PackageName = StartupOptions.PackageName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user