Constructor of the LibraryManager takes the mediaEncoder as parameter
This commit is contained in:
parent
b16ba7d985
commit
0f2ee2686d
|
@ -755,7 +755,18 @@ namespace Emby.Server.Implementations
|
|||
|
||||
serviceCollection.AddSingleton(UserManager);
|
||||
|
||||
LibraryManager = new LibraryManager(this, LoggerFactory, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager);
|
||||
MediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
||||
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(),
|
||||
ServerConfigurationManager,
|
||||
FileSystemManager,
|
||||
ProcessFactory,
|
||||
LocalizationManager,
|
||||
() => SubtitleEncoder,
|
||||
_configuration,
|
||||
StartupOptions.FFmpegPath);
|
||||
serviceCollection.AddSingleton(MediaEncoder);
|
||||
|
||||
LibraryManager = new LibraryManager(this, LoggerFactory, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager, MediaEncoder);
|
||||
serviceCollection.AddSingleton(LibraryManager);
|
||||
|
||||
var musicManager = new MusicManager(LibraryManager);
|
||||
|
@ -833,17 +844,6 @@ namespace Emby.Server.Implementations
|
|||
ChapterManager = new ChapterManager(LibraryManager, LoggerFactory, ServerConfigurationManager, ItemRepository);
|
||||
serviceCollection.AddSingleton(ChapterManager);
|
||||
|
||||
MediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
||||
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(),
|
||||
ServerConfigurationManager,
|
||||
FileSystemManager,
|
||||
ProcessFactory,
|
||||
LocalizationManager,
|
||||
() => SubtitleEncoder,
|
||||
_configuration,
|
||||
StartupOptions.FFmpegPath);
|
||||
serviceCollection.AddSingleton(MediaEncoder);
|
||||
|
||||
EncodingManager = new MediaEncoder.EncodingManager(FileSystemManager, LoggerFactory, MediaEncoder, ChapterManager, LibraryManager);
|
||||
serviceCollection.AddSingleton(EncodingManager);
|
||||
|
||||
|
|
|
@ -143,6 +143,7 @@ namespace Emby.Server.Implementations.Library
|
|||
public bool IsScanRunning { get; private set; }
|
||||
|
||||
private IServerApplicationHost _appHost;
|
||||
private IMediaEncoder _mediaEncoder;
|
||||
|
||||
/// <summary>
|
||||
/// The _library items cache
|
||||
|
@ -176,7 +177,8 @@ namespace Emby.Server.Implementations.Library
|
|||
Func<ILibraryMonitor> libraryMonitorFactory,
|
||||
IFileSystem fileSystem,
|
||||
Func<IProviderManager> providerManagerFactory,
|
||||
Func<IUserViewManager> userviewManager)
|
||||
Func<IUserViewManager> userviewManager,
|
||||
IMediaEncoder mediaEncoder)
|
||||
{
|
||||
_appHost = appHost;
|
||||
_logger = loggerFactory.CreateLogger(nameof(LibraryManager));
|
||||
|
@ -188,6 +190,7 @@ namespace Emby.Server.Implementations.Library
|
|||
_fileSystem = fileSystem;
|
||||
_providerManagerFactory = providerManagerFactory;
|
||||
_userviewManager = userviewManager;
|
||||
_mediaEncoder = mediaEncoder;
|
||||
|
||||
_libraryItemsCache = new ConcurrentDictionary<Guid, BaseItem>();
|
||||
|
||||
|
@ -2416,26 +2419,22 @@ namespace Emby.Server.Implementations.Library
|
|||
if (libraryOptions.EnableEmbeddedEpisodeInfos && string.Equals(episodeInfo.Container, "mp4", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Read from metadata
|
||||
IMediaEncoder mediaEncoder = _appHost.Resolve<IMediaEncoder>();
|
||||
var task = mediaEncoder.GetMediaInfo(new MediaInfoRequest
|
||||
var mediaInfo = _mediaEncoder.GetMediaInfo(new MediaInfoRequest
|
||||
{
|
||||
MediaSource = episode.GetMediaSources(false).First(),
|
||||
MediaType = DlnaProfileType.Video,
|
||||
ExtractChapters = false
|
||||
}, CancellationToken.None);
|
||||
task.Wait();
|
||||
if (task.IsCompletedSuccessfully) {
|
||||
if (task.Result.ParentIndexNumber > 0) {
|
||||
episodeInfo.SeasonNumber = task.Result.ParentIndexNumber;
|
||||
}
|
||||
}, CancellationToken.None).GetAwaiter().GetResult();
|
||||
if (mediaInfo.ParentIndexNumber > 0) {
|
||||
episodeInfo.SeasonNumber = mediaInfo.ParentIndexNumber;
|
||||
}
|
||||
|
||||
if (task.Result.IndexNumber > 0) {
|
||||
episodeInfo.EpisodeNumber = task.Result.IndexNumber;
|
||||
}
|
||||
if (mediaInfo.IndexNumber > 0) {
|
||||
episodeInfo.EpisodeNumber = mediaInfo.IndexNumber;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(task.Result.ShowName)) {
|
||||
episodeInfo.SeriesName = task.Result.ShowName;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(mediaInfo.ShowName)) {
|
||||
episodeInfo.SeriesName = mediaInfo.ShowName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user