Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        /// <summary>
        /// Finds the parts.
        /// </summary>
        protected override void FindParts()
        {
            if (IsFirstRun)
            {
                RegisterServerWithAdministratorAccess();
            }

            base.FindParts();

            HttpServer.Init(GetExports <IRestfulService>(false));

            ServerManager.AddWebSocketListeners(GetExports <IWebSocketListener>(false));

            StartServer(true);

            LibraryManager.AddParts(GetExports <IResolverIgnoreRule>(),
                                    GetExports <IVirtualFolderCreator>(),
                                    GetExports <IItemResolver>(),
                                    GetExports <IIntroProvider>(),
                                    GetExports <IBaseItemComparer>(),
                                    GetExports <ILibraryPrescanTask>(),
                                    GetExports <ILibraryPostScanTask>(),
                                    GetExports <IMetadataSaver>());

            ProviderManager.AddParts(GetExports <BaseMetadataProvider>().ToArray());

            IsoManager.AddParts(GetExports <IIsoMounter>().ToArray());
        }