removed old kernel

This commit is contained in:
Luke Pulverenti 2013-12-15 13:29:34 -05:00
parent ae350c460a
commit a3d855919e
8 changed files with 34 additions and 63 deletions

View File

@ -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)
{

View File

@ -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;
}
}
}

View File

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

View File

@ -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; }
/// <summary>
/// Initializes a new instance of the <see cref="FFMpegManager" /> class.
/// </summary>
@ -42,6 +44,9 @@ namespace MediaBrowser.Controller.MediaInfo
_logger = logger;
_itemRepo = itemRepo;
_fileSystem = fileSystem;
// TODO: Remove this static instance
Instance = this;
}
/// <summary>

View File

@ -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;

View File

@ -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
/// </summary>
class ChapterImagesTask : IScheduledTask
{
/// <summary>
/// The _kernel
/// </summary>
private readonly Kernel _kernel;
/// <summary>
/// The _logger
/// </summary>
@ -48,13 +44,11 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
/// <summary>
/// Initializes a new instance of the <see cref="ChapterImagesTask" /> class.
/// </summary>
/// <param name="kernel">The kernel.</param>
/// <param name="logManager">The log manager.</param>
/// <param name="libraryManager">The library manager.</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);
_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<string> 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)
{

View File

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

View File

@ -1259,6 +1259,18 @@
</Content>
</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" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />