Exemplo n.º 1
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());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Finds the parts.
        /// </summary>
        protected override void FindParts()
        {
            base.FindParts();

            if (IsFirstRun)
            {
                RegisterServerWithAdministratorAccess();
            }

            Parallel.Invoke(

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

                ServerManager.AddWebSocketListeners(GetExports <IWebSocketListener>(false));
                ServerManager.Start();
            },

                () => LibraryManager.AddParts(GetExports <IResolverIgnoreRule>(), GetExports <IVirtualFolderCreator>(), GetExports <IItemResolver>(), GetExports <IIntroProvider>(), GetExports <IBaseItemComparer>()),

                () => ProviderManager.AddMetadataProviders(GetExports <BaseMetadataProvider>().OrderBy(e => e.Priority).ToArray())
                );

            UdpServer = new UdpServer(Logger, NetworkManager, ServerConfigurationManager);

            try
            {
                UdpServer.Start(UdpServerPort);
            }
            catch (SocketException ex)
            {
                Logger.ErrorException("Failed to start UDP Server", ex);
            }
        }
Exemplo n.º 3
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 <ILibraryPostScanTask>());

            ProviderManager.AddParts(GetExports <IImageProvider>(), GetExports <IMetadataService>(), GetExports <IMetadataProvider>(),
                                     GetExports <IMetadataSaver>(),
                                     GetExports <IImageSaver>(),
                                     GetExports <IExternalId>());

            ImageProcessor.AddParts(GetExports <IImageEnhancer>());

            LiveTvManager.AddParts(GetExports <ILiveTvService>());

            SessionManager.AddParts(GetExports <ISessionControllerFactory>());
        }
Exemplo n.º 4
0
        /// <summary>
        /// Finds the parts.
        /// </summary>
        protected override void FindParts()
        {
            // TODO: Remove after next release
            if (!IsFirstRun && !ServerConfigurationManager.Configuration.IsPortAuthorized)
            {
                ServerConfigurationManager.Configuration.IsPortAuthorized = true;
                ConfigurationManager.SaveConfiguration();
            }

            if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
            {
                RegisterServerWithAdministratorAccess();
            }

            base.FindParts();

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

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

            StartServer();

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

            ProviderManager.AddParts(GetExports <IImageProvider>(),
                                     GetExports <IMetadataService>(),
                                     GetExports <IItemIdentityProvider>(),
                                     GetExports <IItemIdentityConverter>(),
                                     GetExports <IMetadataProvider>(),
                                     GetExports <IMetadataSaver>(),
                                     GetExports <IImageSaver>(),
                                     GetExports <IExternalId>());

            SeriesOrderManager.AddParts(GetExports <ISeriesOrderProvider>());

            ImageProcessor.AddParts(GetExports <IImageEnhancer>());

            LiveTvManager.AddParts(GetExports <ILiveTvService>());

            SubtitleManager.AddParts(GetExports <ISubtitleProvider>());
            ChapterManager.AddParts(GetExports <IChapterProvider>());

            SessionManager.AddParts(GetExports <ISessionControllerFactory>());

            ChannelManager.AddParts(GetExports <IChannel>(), GetExports <IChannelFactory>());

            NotificationManager.AddParts(GetExports <INotificationService>(), GetExports <INotificationTypeFactory>());
            SyncManager.AddParts(GetExports <ISyncProvider>());
        }