removed old kernel

pull/702/head
Luke Pulverenti 11 years ago
parent ae350c460a
commit a3d855919e

@ -368,7 +368,7 @@ namespace MediaBrowser.Api.Playback
{ {
var offset = TimeSpan.FromTicks(startTimeTicks ?? 0); 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) if (performConversion)
{ {
@ -413,7 +413,7 @@ namespace MediaBrowser.Api.Playback
var offset = TimeSpan.FromTicks(startTimeTicks ?? 0); 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) if (performConversion)
{ {

@ -1,30 +0,0 @@
using MediaBrowser.Controller.MediaInfo;
namespace MediaBrowser.Controller
{
/// <summary>
/// Class Kernel
/// </summary>
public class Kernel
{
/// <summary>
/// Gets the instance.
/// </summary>
/// <value>The instance.</value>
public static Kernel Instance { get; private set; }
/// <summary>
/// Gets the FFMPEG controller.
/// </summary>
/// <value>The FFMPEG controller.</value>
public FFMpegManager FFMpegManager { get; set; }
/// <summary>
/// Creates a kernel based on a Data path, which is akin to our current programdata path
/// </summary>
public Kernel()
{
Instance = this;
}
}
}

@ -188,7 +188,6 @@
<Compile Include="Library\TVUtils.cs" /> <Compile Include="Library\TVUtils.cs" />
<Compile Include="Library\ItemResolveArgs.cs" /> <Compile Include="Library\ItemResolveArgs.cs" />
<Compile Include="IO\FileData.cs" /> <Compile Include="IO\FileData.cs" />
<Compile Include="Kernel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Providers\BaseMetadataProvider.cs" /> <Compile Include="Providers\BaseMetadataProvider.cs" />
<Compile Include="Session\ISessionController.cs" /> <Compile Include="Session\ISessionController.cs" />

@ -1,5 +1,4 @@
using System.Globalization; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Common.MediaInfo; using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
@ -8,6 +7,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
@ -27,6 +27,8 @@ namespace MediaBrowser.Controller.MediaInfo
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
public static FFMpegManager Instance { get; private set; }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="FFMpegManager" /> class. /// Initializes a new instance of the <see cref="FFMpegManager" /> class.
/// </summary> /// </summary>
@ -42,6 +44,9 @@ namespace MediaBrowser.Controller.MediaInfo
_logger = logger; _logger = logger;
_itemRepo = itemRepo; _itemRepo = itemRepo;
_fileSystem = fileSystem; _fileSystem = fileSystem;
// TODO: Remove this static instance
Instance = this;
} }
/// <summary> /// <summary>

@ -1,8 +1,8 @@
using MediaBrowser.Common.MediaInfo; using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Localization; using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.MediaInfo;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
@ -343,7 +343,7 @@ namespace MediaBrowser.Providers.MediaInfo
video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle); 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; var videoFileChanged = CompareDate(video) > providerInfo.LastRefreshed;

@ -1,7 +1,7 @@
using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaInfo;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
@ -20,10 +20,6 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
/// </summary> /// </summary>
class ChapterImagesTask : IScheduledTask class ChapterImagesTask : IScheduledTask
{ {
/// <summary>
/// The _kernel
/// </summary>
private readonly Kernel _kernel;
/// <summary> /// <summary>
/// The _logger /// The _logger
/// </summary> /// </summary>
@ -48,13 +44,11 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ChapterImagesTask" /> class. /// Initializes a new instance of the <see cref="ChapterImagesTask" /> class.
/// </summary> /// </summary>
/// <param name="kernel">The kernel.</param>
/// <param name="logManager">The log manager.</param> /// <param name="logManager">The log manager.</param>
/// <param name="libraryManager">The library manager.</param> /// <param name="libraryManager">The library manager.</param>
/// <param name="itemRepo">The item repo.</param> /// <param name="itemRepo">The item repo.</param>
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); _logger = logManager.GetLogger(GetType().Name);
_libraryManager = libraryManager; _libraryManager = libraryManager;
_itemRepo = itemRepo; _itemRepo = itemRepo;
@ -108,7 +102,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
{ {
var chapters = _itemRepo.GetChapters(item.Id).ToList(); 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) catch (Exception ex)
{ {
@ -145,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
var numComplete = 0; var numComplete = 0;
var failHistoryPath = Path.Combine(_kernel.FFMpegManager.ChapterImagesPath, "failures.txt"); var failHistoryPath = Path.Combine(FFMpegManager.Instance.ChapterImagesPath, "failures.txt");
List<string> previouslyFailedImages; List<string> previouslyFailedImages;
@ -174,7 +168,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
var chapters = _itemRepo.GetChapters(video.Id).ToList(); 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) if (!success)
{ {

@ -70,12 +70,6 @@ namespace MediaBrowser.ServerApplication
/// </summary> /// </summary>
public class ApplicationHost : BaseApplicationHost<ServerApplicationPaths>, IServerApplicationHost public class ApplicationHost : BaseApplicationHost<ServerApplicationPaths>, IServerApplicationHost
{ {
/// <summary>
/// Gets the server kernel.
/// </summary>
/// <value>The server kernel.</value>
protected Kernel ServerKernel { get; set; }
/// <summary> /// <summary>
/// Gets the server configuration manager. /// Gets the server configuration manager.
/// </summary> /// </summary>
@ -220,8 +214,6 @@ namespace MediaBrowser.ServerApplication
/// <returns>Task.</returns> /// <returns>Task.</returns>
protected override async Task RegisterResources(IProgress<double> progress) protected override async Task RegisterResources(IProgress<double> progress)
{ {
ServerKernel = new Kernel();
await base.RegisterResources(progress).ConfigureAwait(false); await base.RegisterResources(progress).ConfigureAwait(false);
RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory(LogManager, FileSystemManager)); RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory(LogManager, FileSystemManager));
@ -229,7 +221,6 @@ namespace MediaBrowser.ServerApplication
RegisterSingleInstance<IServerApplicationHost>(this); RegisterSingleInstance<IServerApplicationHost>(this);
RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths); RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths);
RegisterSingleInstance(ServerKernel);
RegisterSingleInstance(ServerConfigurationManager); RegisterSingleInstance(ServerConfigurationManager);
RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger)); RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger));
@ -331,11 +322,11 @@ namespace MediaBrowser.ServerApplication
/// </summary> /// </summary>
private void SetKernelProperties() private void SetKernelProperties()
{ {
Parallel.Invoke( new FFMpegManager(ApplicationPaths, MediaEncoder, Logger, ItemRepository, FileSystemManager);
() => ServerKernel.FFMpegManager = new FFMpegManager(ApplicationPaths, MediaEncoder, Logger, ItemRepository, FileSystemManager),
() => LocalizedStrings.StringFiles = GetExports<LocalizedStringData>(), LocalizedStrings.StringFiles = GetExports<LocalizedStringData>();
SetStaticProperties
); SetStaticProperties();
} }
/// <summary> /// <summary>
@ -568,7 +559,7 @@ namespace MediaBrowser.ServerApplication
list.Add(typeof(IApplicationHost).Assembly); list.Add(typeof(IApplicationHost).Assembly);
// Include composable parts in the Controller 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 // Include composable parts in the Providers assembly
list.Add(typeof(ImagesByNameProvider).Assembly); list.Add(typeof(ImagesByNameProvider).Assembly);

@ -1259,6 +1259,18 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="dashboard-ui\css\fonts\OpenSans-ExtraBold.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dashboard-ui\css\fonts\OpenSans-Bold.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dashboard-ui\css\fonts\OpenSans.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dashboard-ui\css\fonts\OpenSans-Light.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Loading…
Cancel
Save