add ability to install pismo
This commit is contained in:
parent
a7c8750b52
commit
75dd40a2ea
|
@ -1,6 +1,7 @@
|
|||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Common.Implementations.Archiving;
|
||||
using MediaBrowser.Common.Implementations.IO;
|
||||
using MediaBrowser.Common.Implementations.NetworkManagement;
|
||||
using MediaBrowser.Common.Implementations.ScheduledTasks;
|
||||
using MediaBrowser.Common.Implementations.Security;
|
||||
|
@ -156,6 +157,8 @@ namespace MediaBrowser.Common.Implementations
|
|||
/// </summary>
|
||||
/// <value>The zip client.</value>
|
||||
protected IZipClient ZipClient { get; set; }
|
||||
|
||||
protected IIsoManager IsoManager { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
|
||||
|
@ -193,18 +196,54 @@ namespace MediaBrowser.Common.Implementations
|
|||
await RegisterResources().ConfigureAwait(false);
|
||||
|
||||
FindParts();
|
||||
|
||||
await InstallIsoMounters(CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when [logger loaded].
|
||||
/// </summary>
|
||||
protected virtual void OnLoggerLoaded()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Installs the iso mounters.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
private async Task InstallIsoMounters(CancellationToken cancellationToken)
|
||||
{
|
||||
var list = new List<IIsoMounter>();
|
||||
|
||||
foreach (var isoMounter in GetExports<IIsoMounter>())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (isoMounter.RequiresInstallation && !isoMounter.IsInstalled)
|
||||
{
|
||||
Logger.Info("Installing {0}", isoMounter.Name);
|
||||
|
||||
await isoMounter.Install(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
list.Add(isoMounter);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("{0} failed to load.", ex, isoMounter.Name);
|
||||
}
|
||||
}
|
||||
|
||||
IsoManager.AddParts(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the startup tasks.
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
public virtual Task RunStartupTasks()
|
||||
public virtual Task RunStartupTasks()
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
|
@ -307,6 +346,9 @@ namespace MediaBrowser.Common.Implementations
|
|||
|
||||
ZipClient = new ZipClient();
|
||||
RegisterSingleInstance(ZipClient);
|
||||
|
||||
IsoManager = new IsoManager();
|
||||
RegisterSingleInstance(IsoManager);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
|
@ -23,5 +23,29 @@ namespace MediaBrowser.Model.IO
|
|||
/// <param name="path">The path.</param>
|
||||
/// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns>
|
||||
bool CanMount(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [requires installation].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [requires installation]; otherwise, <c>false</c>.</value>
|
||||
bool RequiresInstallation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is installed.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is installed; otherwise, <c>false</c>.</value>
|
||||
bool IsInstalled { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Installs this instance.
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
Task Install(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,13 +79,13 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
await _appHost.Init();
|
||||
|
||||
var task = _appHost.RunStartupTasks();
|
||||
|
||||
if (!IsRunningAsService)
|
||||
{
|
||||
HideSplashWindow();
|
||||
}
|
||||
|
||||
var task = _appHost.RunStartupTasks();
|
||||
|
||||
if (!IsRunningAsService)
|
||||
{
|
||||
ShowMainWindow();
|
||||
|
|
|
@ -4,7 +4,6 @@ using MediaBrowser.Common.Configuration;
|
|||
using MediaBrowser.Common.Constants;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Implementations;
|
||||
using MediaBrowser.Common.Implementations.IO;
|
||||
using MediaBrowser.Common.Implementations.ScheduledTasks;
|
||||
using MediaBrowser.Common.MediaInfo;
|
||||
using MediaBrowser.Common.Net;
|
||||
|
@ -25,7 +24,6 @@ using MediaBrowser.Controller.Providers;
|
|||
using MediaBrowser.Controller.Resolvers;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.Sorting;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.System;
|
||||
|
@ -152,7 +150,6 @@ namespace MediaBrowser.ServerApplication
|
|||
/// <value>The media encoder.</value>
|
||||
private IMediaEncoder MediaEncoder { get; set; }
|
||||
|
||||
private IIsoManager IsoManager { get; set; }
|
||||
private ISessionManager SessionManager { get; set; }
|
||||
|
||||
private ILiveTvManager LiveTvManager { get; set; }
|
||||
|
@ -237,9 +234,6 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger));
|
||||
|
||||
IsoManager = new IsoManager();
|
||||
RegisterSingleInstance(IsoManager);
|
||||
|
||||
RegisterSingleInstance<IBlurayExaminer>(() => new BdInfoExaminer());
|
||||
|
||||
var mediaEncoderTask = RegisterMediaEncoder();
|
||||
|
@ -271,7 +265,7 @@ namespace MediaBrowser.ServerApplication
|
|||
RegisterSingleInstance<ILibrarySearchEngine>(() => new LuceneSearchEngine(ApplicationPaths, LogManager, LibraryManager));
|
||||
|
||||
SessionManager = new SessionManager(UserDataRepository, ServerConfigurationManager, Logger, UserRepository);
|
||||
RegisterSingleInstance<ISessionManager>(SessionManager);
|
||||
RegisterSingleInstance(SessionManager);
|
||||
|
||||
HttpServer = await _httpServerCreationTask.ConfigureAwait(false);
|
||||
RegisterSingleInstance(HttpServer, false);
|
||||
|
@ -326,6 +320,10 @@ namespace MediaBrowser.ServerApplication
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user repository.
|
||||
/// </summary>
|
||||
/// <returns>Task{IUserRepository}.</returns>
|
||||
private async Task<IUserRepository> GetUserRepository()
|
||||
{
|
||||
var repo = new SqliteUserRepository(JsonSerializer, LogManager, ApplicationPaths);
|
||||
|
@ -425,8 +423,6 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
ProviderManager.AddParts(GetExports<BaseMetadataProvider>());
|
||||
|
||||
IsoManager.AddParts(GetExports<IIsoMounter>());
|
||||
|
||||
SessionManager.AddParts(GetExports<ISessionRemoteController>());
|
||||
|
||||
ImageProcessor.AddParts(GetExports<IImageEnhancer>());
|
||||
|
|
|
@ -119,9 +119,9 @@
|
|||
<Reference Include="Hardcodet.Wpf.TaskbarNotification">
|
||||
<HintPath>..\packages\Hardcodet.Wpf.TaskbarNotification.1.0.4.0\lib\net40\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MediaBrowser.IsoMounter, Version=1.0.4969.36586, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="MediaBrowser.IsoMounter, Version=1.0.5021.28866, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.56\lib\net45\MediaBrowser.IsoMounter.dll</HintPath>
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.60\lib\net45\MediaBrowser.IsoMounter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
@ -129,7 +129,7 @@
|
|||
</Reference>
|
||||
<Reference Include="pfmclrapi, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.56\lib\net45\pfmclrapi.dll</HintPath>
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.60\lib\net45\pfmclrapi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack, Version=3.9.60.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Hardcodet.Wpf.TaskbarNotification" version="1.0.4.0" targetFramework="net45" />
|
||||
<package id="MediaBrowser.IsoMounting" version="3.0.56" targetFramework="net45" />
|
||||
<package id="MediaBrowser.IsoMounting" version="3.0.60" targetFramework="net45" />
|
||||
<package id="NLog" version="2.0.1.2" targetFramework="net45" />
|
||||
<package id="ServiceStack" version="3.9.62" targetFramework="net45" />
|
||||
<package id="ServiceStack.Common" version="3.9.62" targetFramework="net45" />
|
||||
|
|
|
@ -918,9 +918,6 @@
|
|||
<Content Include="dashboard-ui\css\images\clients\windowsphone.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\css\images\clients\win8.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="dashboard-ui\css\images\notifications\download.png">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.211</version>
|
||||
<version>3.0.212</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.211" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.212" />
|
||||
<dependency id="NLog" version="2.0.1.2" />
|
||||
<dependency id="ServiceStack.Text" version="3.9.58" />
|
||||
<dependency id="SimpleInjector" version="2.3.2" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.211</version>
|
||||
<version>3.0.212</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.211</version>
|
||||
<version>3.0.212</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.211" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.212" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user