diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 90996296d5..5bdf39eef8 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -368,7 +368,7 @@ namespace MediaBrowser.Api.Playback
{
var offset = TimeSpan.FromTicks(startTimeTicks ?? 0);
- var path = Kernel.Instance.FFMpegManager.GetSubtitleCachePath(video, subtitleStream.Index, offset, ".ass");
+ var path = FFMpegManager.Instance.GetSubtitleCachePath(video, subtitleStream.Index, offset, ".ass");
if (performConversion)
{
@@ -413,7 +413,7 @@ namespace MediaBrowser.Api.Playback
var offset = TimeSpan.FromTicks(startTimeTicks ?? 0);
- var path = Kernel.Instance.FFMpegManager.GetSubtitleCachePath(video, subtitleStream.Index, offset, ".ass");
+ var path = FFMpegManager.Instance.GetSubtitleCachePath(video, subtitleStream.Index, offset, ".ass");
if (performConversion)
{
diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs
deleted file mode 100644
index 37a1648c17..0000000000
--- a/MediaBrowser.Controller/Kernel.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using MediaBrowser.Controller.MediaInfo;
-
-namespace MediaBrowser.Controller
-{
- ///
- /// Class Kernel
- ///
- public class Kernel
- {
- ///
- /// Gets the instance.
- ///
- /// The instance.
- public static Kernel Instance { get; private set; }
-
- ///
- /// Gets the FFMPEG controller.
- ///
- /// The FFMPEG controller.
- public FFMpegManager FFMpegManager { get; set; }
-
- ///
- /// Creates a kernel based on a Data path, which is akin to our current programdata path
- ///
- public Kernel()
- {
- Instance = this;
- }
- }
-}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index df108b5902..705a0ea685 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -188,7 +188,6 @@
-
diff --git a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
index 445eb9fa53..380a96387e 100644
--- a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
+++ b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
@@ -1,5 +1,4 @@
-using System.Globalization;
-using MediaBrowser.Common.Extensions;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller.Entities;
@@ -8,6 +7,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
@@ -27,6 +27,8 @@ namespace MediaBrowser.Controller.MediaInfo
private readonly IFileSystem _fileSystem;
+ public static FFMpegManager Instance { get; private set; }
+
///
/// Initializes a new instance of the class.
///
@@ -42,6 +44,9 @@ namespace MediaBrowser.Controller.MediaInfo
_logger = logger;
_itemRepo = itemRepo;
_fileSystem = fileSystem;
+
+ // TODO: Remove this static instance
+ Instance = this;
}
///
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs
index 7e3e3da3b5..a2a4d5bbf4 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs
@@ -1,8 +1,8 @@
using MediaBrowser.Common.MediaInfo;
-using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Localization;
+using MediaBrowser.Controller.MediaInfo;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
@@ -343,7 +343,7 @@ namespace MediaBrowser.Providers.MediaInfo
video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle);
- await Kernel.Instance.FFMpegManager.PopulateChapterImages(video, chapters, false, false, cancellationToken).ConfigureAwait(false);
+ await FFMpegManager.Instance.PopulateChapterImages(video, chapters, false, false, cancellationToken).ConfigureAwait(false);
var videoFileChanged = CompareDate(video) > providerInfo.LastRefreshed;
diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
index 7af077785b..60c8df8c1f 100644
--- a/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
+++ b/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
@@ -1,7 +1,7 @@
using MediaBrowser.Common.ScheduledTasks;
-using MediaBrowser.Controller;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.MediaInfo;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
@@ -20,10 +20,6 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
///
class ChapterImagesTask : IScheduledTask
{
- ///
- /// The _kernel
- ///
- private readonly Kernel _kernel;
///
/// The _logger
///
@@ -48,13 +44,11 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
///
/// Initializes a new instance of the class.
///
- /// The kernel.
/// The log manager.
/// The library manager.
/// The item repo.
- public ChapterImagesTask(Kernel kernel, ILogManager logManager, ILibraryManager libraryManager, IItemRepository itemRepo)
+ public ChapterImagesTask(ILogManager logManager, ILibraryManager libraryManager, IItemRepository itemRepo)
{
- _kernel = kernel;
_logger = logManager.GetLogger(GetType().Name);
_libraryManager = libraryManager;
_itemRepo = itemRepo;
@@ -108,7 +102,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
{
var chapters = _itemRepo.GetChapters(item.Id).ToList();
- await _kernel.FFMpegManager.PopulateChapterImages(item, chapters, true, true, CancellationToken.None);
+ await FFMpegManager.Instance.PopulateChapterImages(item, chapters, true, true, CancellationToken.None);
}
catch (Exception ex)
{
@@ -145,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
var numComplete = 0;
- var failHistoryPath = Path.Combine(_kernel.FFMpegManager.ChapterImagesPath, "failures.txt");
+ var failHistoryPath = Path.Combine(FFMpegManager.Instance.ChapterImagesPath, "failures.txt");
List previouslyFailedImages;
@@ -174,7 +168,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
var chapters = _itemRepo.GetChapters(video.Id).ToList();
- var success = await _kernel.FFMpegManager.PopulateChapterImages(video, chapters, extract, true, cancellationToken);
+ var success = await FFMpegManager.Instance.PopulateChapterImages(video, chapters, extract, true, cancellationToken);
if (!success)
{
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs
index 77b49fbf11..83d8d65040 100644
--- a/MediaBrowser.ServerApplication/ApplicationHost.cs
+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs
@@ -70,12 +70,6 @@ namespace MediaBrowser.ServerApplication
///
public class ApplicationHost : BaseApplicationHost, IServerApplicationHost
{
- ///
- /// Gets the server kernel.
- ///
- /// The server kernel.
- protected Kernel ServerKernel { get; set; }
-
///
/// Gets the server configuration manager.
///
@@ -220,8 +214,6 @@ namespace MediaBrowser.ServerApplication
/// Task.
protected override async Task RegisterResources(IProgress progress)
{
- ServerKernel = new Kernel();
-
await base.RegisterResources(progress).ConfigureAwait(false);
RegisterSingleInstance(new HttpResultFactory(LogManager, FileSystemManager));
@@ -229,7 +221,6 @@ namespace MediaBrowser.ServerApplication
RegisterSingleInstance(this);
RegisterSingleInstance(ApplicationPaths);
- RegisterSingleInstance(ServerKernel);
RegisterSingleInstance(ServerConfigurationManager);
RegisterSingleInstance(() => new AlchemyServer(Logger));
@@ -331,11 +322,11 @@ namespace MediaBrowser.ServerApplication
///
private void SetKernelProperties()
{
- Parallel.Invoke(
- () => ServerKernel.FFMpegManager = new FFMpegManager(ApplicationPaths, MediaEncoder, Logger, ItemRepository, FileSystemManager),
- () => LocalizedStrings.StringFiles = GetExports(),
- SetStaticProperties
- );
+ new FFMpegManager(ApplicationPaths, MediaEncoder, Logger, ItemRepository, FileSystemManager);
+
+ LocalizedStrings.StringFiles = GetExports();
+
+ SetStaticProperties();
}
///
@@ -568,7 +559,7 @@ namespace MediaBrowser.ServerApplication
list.Add(typeof(IApplicationHost).Assembly);
// Include composable parts in the Controller assembly
- list.Add(typeof(Kernel).Assembly);
+ list.Add(typeof(IServerApplicationHost).Assembly);
// Include composable parts in the Providers assembly
list.Add(typeof(ImagesByNameProvider).Assembly);
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index a71096c33a..8fbd6a6316 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -1259,6 +1259,18 @@
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+