Exemple #1
0
        /// <summary>
        /// Runs the application.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="logManager">The log manager.</param>
        /// <param name="options">The options.</param>
        private static void StartApplication(ServerApplicationPaths appPaths,
                                             ILogManager logManager,
                                             StartupOptions options)
        {
            // Allow all https requests
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), false, false, appPaths.TempDirectory);

            fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));

            _fileSystem = fileSystem;

            var environmentInfo = GetEnvironmentInfo();

            var imageEncoder = ImageEncoderHelper.GetImageEncoder(_logger,
                                                                  logManager,
                                                                  fileSystem,
                                                                  options,
                                                                  () => AppHost.HttpClient,
                                                                  appPaths);

            AppHost = new MacAppHost(appPaths,
                                     logManager,
                                     options,
                                     fileSystem,
                                     new PowerManagement(),
                                     "Emby.Server.Mac.pkg",
                                     environmentInfo,
                                     imageEncoder,
                                     new Startup.Common.SystemEvents(logManager.GetLogger("SystemEvents")),
                                     new MemoryStreamProvider(),
                                     new NetworkManager(logManager.GetLogger("NetworkManager")),
                                     GenerateCertificate,
                                     () => Environment.UserName);

            if (options.ContainsOption("-v"))
            {
                Console.WriteLine(AppHost.ApplicationVersion.ToString());
                return;
            }

            Console.WriteLine("appHost.Init");

            Task.Run(() => StartServer(CancellationToken.None));
        }
Exemple #2
0
        /// <summary>
        /// Runs the application.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="logManager">The log manager.</param>
        /// <param name="options">The options.</param>
        private static void StartApplication(ServerApplicationPaths appPaths,
                                             ILogManager logManager,
                                             StartupOptions options)
        {
            // Allow all https requests
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            var environmentInfo = GetEnvironmentInfo();

            var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), environmentInfo, appPaths.TempDirectory);

            _fileSystem = fileSystem;

            var imageEncoder = GetImageEncoder(appPaths, fileSystem, logManager);

            AppHost = new MacAppHost(appPaths,
                                     logManager,
                                     options,
                                     fileSystem,
                                     new PowerManagement(),
                                     "Emby.Server.Mac.pkg",
                                     environmentInfo,
                                     imageEncoder,
                                     new SystemEvents(logManager.GetLogger("SystemEvents")),
                                     new NetworkManager(logManager.GetLogger("NetworkManager")));

            if (options.ContainsOption("-v"))
            {
                Console.WriteLine(AppHost.ApplicationVersion.ToString());
                return;
            }

            Console.WriteLine("appHost.Init");

            Task.Run(() => StartServer(CancellationToken.None));
        }