Пример #1
0
 public HistoryController(HistoryProvider historyProvider, JobProvider jobProvider,
                             ConfigProvider configProvider)
 {
     _historyProvider = historyProvider;
     _jobProvider = jobProvider;
     _configProvider = configProvider;
 }
Пример #2
0
 public PastWeekBacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob,
                                     ConfigProvider configProvider)
 {
     _episodeProvider = episodeProvider;
     _episodeSearchJob = episodeSearchJob;
     _configProvider = configProvider;
 }
Пример #3
0
 public DiskScanJob(SeriesProvider seriesProvider, DiskScanProvider diskScanProvider,
                     ConfigProvider configProvider)
 {
     _seriesProvider = seriesProvider;
     _diskScanProvider = diskScanProvider;
     _configProvider = configProvider;
 }
Пример #4
0
 public UpdateProvider(HttpProvider httpProvider, ConfigProvider configProvider,
     EnvironmentProvider environmentProvider, DiskProvider diskProvider)
 {
     _httpProvider = httpProvider;
     _configProvider = configProvider;
     _environmentProvider = environmentProvider;
     _diskProvider = diskProvider;
 }
Пример #5
0
 public SeriesProvider(IDatabase database, ConfigProvider configProviderProvider,
                         TvDbProvider tvDbProviderProvider, SceneMappingProvider sceneNameMappingProvider)
 {
     _database = database;
     _configProvider = configProviderProvider;
     _tvDbProvider = tvDbProviderProvider;
     _sceneNameMappingProvider = sceneNameMappingProvider;
 }
Пример #6
0
 public BacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob,
                             SeasonSearchJob seasonSearchJob, ConfigProvider configProvider)
 {
     _episodeProvider = episodeProvider;
     _episodeSearchJob = episodeSearchJob;
     _seasonSearchJob = seasonSearchJob;
     _configProvider = configProvider;
 }
Пример #7
0
 public UpdateInfoJob(SeriesProvider seriesProvider, EpisodeProvider episodeProvider,
                     ReferenceDataProvider referenceDataProvider, ConfigProvider configProvider)
 {
     _seriesProvider = seriesProvider;
     _episodeProvider = episodeProvider;
     _referenceDataProvider = referenceDataProvider;
     _configProvider = configProvider;
 }
Пример #8
0
        //
        // GET: /Series/

        public SeriesController(SeriesProvider seriesProvider, QualityProvider qualityProvider, 
                                    JobProvider jobProvider, SeasonProvider seasonProvider,
                                    ConfigProvider configProvider)
        {
            _seriesProvider = seriesProvider;
            _qualityProvider = qualityProvider;
            _jobProvider = jobProvider;
            _seasonProvider = seasonProvider;
            _configProvider = configProvider;
        }
Пример #9
0
 public SystemController(JobProvider jobProvider, IndexerProvider indexerProvider,
                             ConfigProvider configProvider, DiskProvider diskProvider,
                             BackupProvider backupProvider)
 {
     _jobProvider = jobProvider;
     _indexerProvider = indexerProvider;
     _configProvider = configProvider;
     _diskProvider = diskProvider;
     _backupProvider = backupProvider;
 }
Пример #10
0
 public SeriesProvider(IDatabase database, ConfigProvider configProviderProvider,
                         TvDbProvider tvDbProviderProvider, SceneMappingProvider sceneNameMappingProvider,
                         BannerProvider bannerProvider, MetadataProvider metadataProvider)
 {
     _database = database;
     _configProvider = configProviderProvider;
     _tvDbProvider = tvDbProviderProvider;
     _sceneNameMappingProvider = sceneNameMappingProvider;
     _bannerProvider = bannerProvider;
     _metadataProvider = metadataProvider;
 }
Пример #11
0
 public RssSyncJob(DownloadProvider downloadProvider, IndexerProvider indexerProvider,
     MonitoredEpisodeSpecification isMonitoredEpisodeSpecification, AllowedDownloadSpecification allowedDownloadSpecification, 
     UpgradeHistorySpecification upgradeHistorySpecification, ConfigProvider configProvider)
 {
     _downloadProvider = downloadProvider;
     _indexerProvider = indexerProvider;
     _isMonitoredEpisodeSpecification = isMonitoredEpisodeSpecification;
     _allowedDownloadSpecification = allowedDownloadSpecification;
     _upgradeHistorySpecification = upgradeHistorySpecification;
     _configProvider = configProvider;
 }
Пример #12
0
 public DownloadProvider(SabProvider sabProvider, HistoryProvider historyProvider,
     EpisodeProvider episodeProvider, ExternalNotificationProvider externalNotificationProvider,
     ConfigProvider configProvider, BlackholeProvider blackholeProvider,
     SignalRProvider signalRProvider)
 {
     _sabProvider = sabProvider;
     _historyProvider = historyProvider;
     _episodeProvider = episodeProvider;
     _externalNotificationProvider = externalNotificationProvider;
     _configProvider = configProvider;
     _blackholeProvider = blackholeProvider;
     _signalRProvider = signalRProvider;
 }
Пример #13
0
        public AddSeriesController(RootDirProvider rootFolderProvider,
                                   ConfigProvider configProvider,
                                   QualityProvider qualityProvider, TvDbProvider tvDbProvider,
                                   SeriesProvider seriesProvider, JobProvider jobProvider,
                                   DiskProvider diskProvider)
        {

            _rootFolderProvider = rootFolderProvider;
            _configProvider = configProvider;
            _qualityProvider = qualityProvider;
            _tvDbProvider = tvDbProvider;
            _seriesProvider = seriesProvider;
            _jobProvider = jobProvider;
            _diskProvider = diskProvider;
        }
Пример #14
0
 public SettingsController(ConfigProvider configProvider, IndexerProvider indexerProvider,
                           QualityProvider qualityProvider, AutoConfigureProvider autoConfigureProvider,
                           SeriesProvider seriesProvider, ExternalNotificationProvider externalNotificationProvider,
                           QualityTypeProvider qualityTypeProvider,
                           ConfigFileProvider configFileProvider, NewznabProvider newznabProvider)
 {
     _externalNotificationProvider = externalNotificationProvider;
     _qualityTypeProvider = qualityTypeProvider;
     _configFileProvider = configFileProvider;
     _newznabProvider = newznabProvider;
     _configProvider = configProvider;
     _indexerProvider = indexerProvider;
     _qualityProvider = qualityProvider;
     _autoConfigureProvider = autoConfigureProvider;
     _seriesProvider = seriesProvider;
 }
Пример #15
0
 public DiskScanProvider(DiskProvider diskProvider, EpisodeProvider episodeProvider,
                         SeriesProvider seriesProvider, MediaFileProvider mediaFileProvider,
                         ExternalNotificationProvider externalNotificationProvider, DownloadProvider downloadProvider,
                         SignalRProvider signalRProvider, ConfigProvider configProvider,
                         RecycleBinProvider recycleBinProvider)
 {
     _diskProvider = diskProvider;
     _episodeProvider = episodeProvider;
     _seriesProvider = seriesProvider;
     _mediaFileProvider = mediaFileProvider;
     _externalNotificationProvider = externalNotificationProvider;
     _downloadProvider = downloadProvider;
     _signalRProvider = signalRProvider;
     _configProvider = configProvider;
     _recycleBinProvider = recycleBinProvider;
 }
Пример #16
0
        public async Task Smoke()
        {
            Type type1 = typeof(ITxPoolConfig);
            Type type2 = typeof(INetworkConfig);
            Type type3 = typeof(IKeyStoreConfig);
            Type type4 = typeof(IDbConfig);
            Type type5 = typeof(IStatsConfig);
            Type type6 = typeof(IKafkaConfig);
            Type type7 = typeof(IEthStatsConfig);

            var configProvider = new ConfigProvider();

            configProvider.AddSource(new ConfigSource());

            Console.WriteLine(type1.Name);
            Console.WriteLine(type2.Name);
            Console.WriteLine(type3.Name);
            Console.WriteLine(type4.Name);
            Console.WriteLine(type5.Name);
            Console.WriteLine(type6.Name);
            Console.WriteLine(type7.Name);

            EthereumRunner runner = new EthereumRunner(
                new RpcModuleProvider(new JsonRpcConfig(), LimboLogs.Instance),
                configProvider,
                LimboLogs.Instance,
                Substitute.For <IGrpcServer>(),
                Substitute.For <INdmConsumerChannelManager>(),
                Substitute.For <INdmDataPublisher>(),
                Substitute.For <INdmInitializer>(),
                Substitute.For <IWebSocketsManager>(),
                new EthereumJsonSerializer(), Substitute.For <IMonitoringService>());

            await runner.Start();

            await runner.StopAsync();
        }
Пример #17
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(o => o.AddPolicy("CorsPolicy", builder =>
            {
                builder
                .AllowAnyHeader()
                .AllowAnyMethod()
                .WithOrigins("http://localhost:3000")
                .AllowCredentials();
            }));
            services.AddControllers();
            services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
            .AddJwtBearer(o =>
            {
                o.TokenValidationParameters = new TokenValidationParameters
                {
                    ValidateIssuerSigningKey = true,
                    IssuerSigningKey         = new SymmetricSecurityKey(ConfigProvider.GetTokenKey()),
                    ValidateIssuer           = false,
                    ValidateAudience         = false,
                };
            });

            services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
            services.AddRepositories();
            services.AddServices();
            services.AddScheduledTasks();
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "Cebulit.API", Version = "v1"
                });
            });
            services.AddDbContext <DataContext>(options =>
                                                options.UseSqlite($"Data Source={Configuration.GetConnectionString("DefaultConnection")}", o => o.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery)));
            services.AddDatabaseDeveloperPageExceptionFilter();
        }
Пример #18
0
        public async Task RunExample(string[] args)
        {
            _configProvider = new ConfigProvider(args);
            _bitmovinApi    = BitmovinApi.Builder
                              .WithApiKey(_configProvider.GetBitmovinApiKey())
                              .WithLogger(new ConsoleLogger())
                              .Build();

            var encoding = await CreateEncoding("Per-Title encoding", "Per-Title encoding with HLS and DASH manifest");

            var input = await CreateHttpInput(_configProvider.GetHttpInputHost());

            var output = await CreateS3Output(_configProvider.GetS3OutputBucketName(),
                                              _configProvider.GetS3OutputAccessKey(),
                                              _configProvider.GetS3OutputSecretKey());

            var inputFilePath = _configProvider.GetHttpInputFilePath();

            // Add an H.264 video stream to the encoding
            var h264VideoConfig = await CreateH264VideoConfiguration();

            var h264VideoStream = await CreateStream(encoding, input, inputFilePath, h264VideoConfig, StreamMode.PER_TITLE_TEMPLATE);

            // Add an AAC audio stream to the encoding
            var aacConfig = await CreateAacAudioConfiguration();

            var aacAudioStream = await CreateStream(encoding, input, inputFilePath, aacConfig, StreamMode.STANDARD);

            await CreateFmp4Muxing(encoding, output, "video/{height}/{bitrate}_{uuid}", h264VideoStream);
            await CreateFmp4Muxing(encoding, output, $"/audio/{aacConfig.Bitrate / 1000}kbs",
                                   aacAudioStream);

            await ExecuteEncoding(encoding);

            await GenerateDashManifest(encoding, output, "/");
            await GenerateHlsManifest(encoding, output, "/");
        }
Пример #19
0
        public async Task RunExample(string[] args)
        {
            _configProvider = new ConfigProvider(args);
            _bitmovinApi    = BitmovinApi.Builder
                              .WithApiKey(_configProvider.GetBitmovinApiKey())
                              .WithLogger(new ConsoleLogger())
                              .Build();

            var encoding = await CreateEncoding("Encoding with default manifests",
                                                "Encoding with HLS and DASH default manifests");

            var input = await CreateHttpInput(_configProvider.GetHttpInputHost());

            var output = await CreateS3Output(_configProvider.GetS3OutputBucketName(),
                                              _configProvider.GetS3OutputAccessKey(),
                                              _configProvider.GetS3OutputSecretKey());

            var inputFilePath = _configProvider.GetHttpInputFilePath();

            // Add an H.264 video stream to the encoding
            var h264VideoConfig = await CreateH264VideoConfiguration();

            var h264VideoStream = await CreateStream(encoding, input, inputFilePath, h264VideoConfig);

            // Add an AAC audio stream to the encoding
            var aacConfig = await CreateAacAudioConfiguration();

            var aacAudioStream = await CreateStream(encoding, input, inputFilePath, aacConfig);

            await CreateFmp4Muxing(encoding, output, "video", h264VideoStream);
            await CreateFmp4Muxing(encoding, output, "audio", aacAudioStream);

            await ExecuteEncoding(encoding);

            await GenerateDashManifest(encoding, output, "/");
            await GenerateHlsManifest(encoding, output, "/");
        }
Пример #20
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         BaseConfigInfo baseConfigInfo = ConfigProvider.GetCacheBaseConfig();
         if (baseConfigInfo == null)
         {
             baseConfigInfo = new BaseConfigInfo();
         }
         baseConfigInfo.UserNameRule        = WebUtils.GetString(this.TextBox2.Text);
         baseConfigInfo.SysUserName         = WebUtils.GetString(this.TextBox3.Text);
         baseConfigInfo.RegAgreement        = StringUtils.ChkSQL(this.TextBox6.Text);
         baseConfigInfo.RegGiveIntegral     = WebUtils.GetInt(this.TextBox7.Text, 10);
         baseConfigInfo.TgIntegral          = WebUtils.GetInt(this.TextBox8.Text, 50);
         baseConfigInfo.VerifycodeForReg    = this.CheckBox1.Checked;
         baseConfigInfo.VerifycodeForLogin  = this.CheckBox2.Checked;
         baseConfigInfo.VerifycodeForGetPwd = this.CheckBox3.Checked;
         baseConfigInfo.TryLoginTimes       = WebUtils.GetInt(this.TextBox9.Text, 5);
         baseConfigInfo.CookieTime          = this.RadioButtonList10.SelectedValue;
         if (ConfigProvider.Update(baseConfigInfo))
         {
             CacheUtils.Del("JsonLeeCMS_CacheForGetBaseConfig");
             CacheUtils.Del("JsonLeeCMS_CacheForVER");
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "更新会员配置成功");
             base.ShowMsg("Cập nhật thành công");
         }
         else
         {
             base.ShowMsg("Cập nhật thất bại");
         }
     }
 }
Пример #21
0
        public void Basic_configs_are_as_expected(string configFile, bool isProduction = false)
        {
            ConfigProvider configProvider = GetConfigProviderFromFile(configFile);
            IInitConfig    initConfig     = configProvider.GetConfig <IInitConfig>();

            Assert.True(initConfig.DiscoveryEnabled, nameof(initConfig.DiscoveryEnabled));
            Assert.True(initConfig.ProcessingEnabled, nameof(initConfig.ProcessingEnabled));
            Assert.True(initConfig.PeerManagerEnabled, nameof(initConfig.PeerManagerEnabled));
            Assert.True(initConfig.SynchronizationEnabled, nameof(initConfig.SynchronizationEnabled));
            Assert.False(initConfig.WebSocketsEnabled, nameof(initConfig.WebSocketsEnabled));
            if (isProduction)
            {
                Assert.False(initConfig.EnableUnsecuredDevWallet, nameof(initConfig.EnableUnsecuredDevWallet));
            }

            Assert.False(initConfig.KeepDevWalletInMemory, nameof(initConfig.KeepDevWalletInMemory));
            Assert.False(initConfig.IsMining, nameof(initConfig.IsMining));
            Assert.False(initConfig.EnableRc7Fix, nameof(initConfig.EnableRc7Fix));
            Assert.True(initConfig.StoreReceipts, nameof(initConfig.StoreReceipts));
            Assert.False(initConfig.StoreTraces, nameof(initConfig.StoreTraces));

            Assert.AreEqual(configFile.Replace("cfg", "logs.txt"), initConfig.LogFileName, nameof(initConfig.LogFileName));
            Assert.AreEqual("chainspec", initConfig.ChainSpecFormat, nameof(initConfig.ChainSpecFormat));
        }
        private void Deploy(WorkerApplication application)
        {
            var publishProfile = _webApps[application].GetPublishingProfile();



            FtpClient client = new FtpClient();
            var       url    = publishProfile.FtpUrl;

            Uri myUri = new Uri("https://" + url);
            var ip    = Dns.GetHostAddresses(myUri.Host)[0];

            client.Host = ip.ToString();

            client.Credentials = new NetworkCredential(publishProfile.FtpUsername, publishProfile.FtpPassword);
            var files =
                Directory.GetFiles(
                    Path.Combine(ConfigProvider.GetValue("OutputFolderPath"), application.Name, "build"), "*",
                    SearchOption.AllDirectories);

            foreach (var file in files)
            {
                Uri fullPath = new Uri(file, UriKind.Absolute);
                Uri relRoot  = new Uri(Path.Combine(ConfigProvider.GetValue("OutputFolderPath"), application.Name, "build"), UriKind.Absolute);

                string relPath = relRoot.MakeRelativeUri(fullPath).ToString();
                client.UploadFile(file, (@"\site\wwwroot\App_Data\Jobs\continuous\Worker" + "\\" + relPath.Substring(6)), true, true);
                if (Path.GetFileName(file.ToLower()).Contains("packages.config"))
                {
                    client.UploadFile(file, (@"\site\wwwroot" + "\\" + relPath.Substring(6)), true, true);
                }
            }
            _webApps[application].Refresh();
            DeployedApplications.Add(application);
            client.Dispose();
        }
Пример #23
0
        public void GetConfigValue_WhenConfigKeyIsInvalid_ThrowsProperArgumentException()
        {
            // Arrange
            var configKey   = "InvalidKey";
            var mockOptions = new Mock <IOptions <ExternalApiSettings> >();

            mockOptions
            .Setup(o => o.Value)
            .Returns(new ExternalApiSettings()
            {
                Token = TokenValue, BaseUrl = BaseUrlValue
            });

            var sutConfigProvider = new ConfigProvider(mockOptions.Object);
            // Act
            Action action = () => sutConfigProvider.GetConfigValue(configKey);

            // Assert
            var expectedErrorMessage = $"ConfigKey '{configKey}' is not valid.";

            action.Should()
            .ThrowExactly <ArgumentException>()
            .WithMessage(expectedErrorMessage);
        }
Пример #24
0
        public MainWindowViewModel(MigoProxyService migoProxyService, ConfigProvider configProvider)
        {
            Activator = new ViewModelActivator();

            _cancellationTokenSource = new CancellationTokenSource();
            _migoProxyService        = migoProxyService;
            _configProvider          = configProvider;

            PreheatEnabled     = true;
            PreheatTemperature = 100;
            GcodeFileName      = string.Empty;
            State = "Idle";

            ManualControl      = new ManualControlViewModel(migoProxyService);
            ZOffsetCalibration = new ZOffsetCalibrationModel(migoProxyService);

            Endpoints     = new ObservableCollection <MigoEndpoint>();
            NozzleTValues = new ObservableCollection <TemperaturePoint>();
            BedTValues    = new ObservableCollection <TemperaturePoint>();

            ShowEndpointsDialog        = new Interaction <EndpointsDialogViewModel, EndpointsListModel>();
            ShowEndpointsDialogCommand = ReactiveCommand.CreateFromTask(OnShowEndpointsDialog);

            GCodeFileSelected = ReactiveCommand.CreateFromTask(
                (Func <string, Task>)OnGCodeFileSelected);

            var canStartPrint = this
                                .WhenAnyValue(model => model.GcodeFileName)
                                .Select(x => !string.IsNullOrEmpty(x))
                                .ObserveOn(RxApp.MainThreadScheduler);

            StartPrintCommand = ReactiveCommand.CreateFromTask(StartPrint, canStartPrint);
            StopPrintCommand  = ReactiveCommand.CreateFromTask(StopPrint);

            this.WhenActivated(OnActivated);
        }
Пример #25
0
        public async Task RunExample(string[] args)
        {
            _configProvider = new ConfigProvider(args);

            /****初始化连接器****/
            ArApiProvider.Reset(_configProvider.GetAppKey(), _configProvider.GetAppSecret());

            /****登陆并设置AuthToken****/
            AccountInfo loginAccount = await ArApiProvider.Instance.Account.LoginAsync("13123456789", "123789");

            ArApiProvider.Reset(loginAccount.AuthToken);

            /****图录详情****/
            var album = await ArApiProvider.Instance.Album.GetAsync("album_num");

            /****图录列表****/
            var albums = await ArApiProvider.Instance.Album.ListAsync(true, "id", 1, 1000);

            /****收藏图录****/
            await ArApiProvider.Instance.Album.FavAsync("album_num");

            /****激活图录****/
            await ArApiProvider.Instance.Album.ActiveAsync("album_num", "code_num");
        }
Пример #26
0
 public ReferenceDataProvider(IDatabase database, HttpProvider httpProvider, ConfigProvider configProvider)
 {
     _database = database;
     _httpProvider = httpProvider;
     _configProvider = configProvider;
 }
Пример #27
0
 public DefaultEnabledIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #28
0
 public MediaFileProvider(EpisodeProvider episodeProvider, ConfigProvider configProvider, IDatabase database)
 {
     _episodeProvider = episodeProvider;
     _configProvider  = configProvider;
     _database        = database;
 }
Пример #29
0
 public DefaultEnabledIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #30
0
 public CustomParserIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #31
0
 /// <summary>
 ///     Load a config in the default shortcut list.
 /// </summary>
 /// <param name="config">The config to load</param>
 private void setDefaultConfig(ConfigProvider config)
 {
     config.NewShortcutEvent += (ShortcutData shortcut) =>
     {
         log.Info("New shortcut: " + shortcut);
         mDefaultShortcutsList.Add(shortcut);
     };
     config.parseConfig();
 }
Пример #32
0
 public MediaFileProvider(EpisodeProvider episodeProvider, ConfigProvider configProvider, IDatabase database)
 {
     _episodeProvider = episodeProvider;
     _configProvider = configProvider;
     _database = database;
 }
Пример #33
0
            /// <summary>
            ///     Private constructor.
            /// </summary>
            /// <param name="config">The config to read.</param>
            /// <remarks>To retrieve an instance of this class, use <see cref="getInstance"/>.</remarks>
            private Handler(ConfigProvider config)
            {
                mActionQueue = new Queue<int>();
                mActionSemaphore = new Semaphore(0, 50);
                
                mHookHandler = new HookHandler();

                loadShortcut(ShortcutData.exitShortcut, -1, false);
                loadShortcut(ShortcutData.resetShortcut, -2, false);

                mDefaultShortcutsList = new List<ShortcutData>();
                setDefaultConfig(config);

                mCurrentShortcutsList = mDefaultShortcutsList;
                loadShortcuts();
            }
Пример #34
0
 public SceneMappingProvider(IDatabase database, HttpProvider httpProvider, ConfigProvider configProvider)
 {
     _database = database;
     _httpProvider = httpProvider;
     _configProvider = configProvider;
 }
Пример #35
0
        public void Should_only_map_source_members()
        {
            var typeMap = ConfigProvider.FindTypeMapFor <Source, Destination>();

            typeMap.GetPropertyMaps().Count().ShouldBe(1);
        }
Пример #36
0
 public GuestModifierFactory(ConfigProvider configProvider)
 {
     _context = new GuestModifierContext(configProvider);
 }
Пример #37
0
 public Twitter(ConfigProvider configProvider, TwitterProvider twitterProvider)
     : base(configProvider)
 {
     _twitterProvider = twitterProvider;
 }
Пример #38
0
 public TestUrlIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #39
0
 public TestUrlIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #40
0
 public CustomParserIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #41
0
 public NotConfiguredIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #42
0
 public NotConfiguredIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #43
0
 public MockIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }
Пример #44
0
 public static void ImplReadFrom(IGeneratedStore s, ConfigProvider provider) => FindImpl(s).ReadFrom(provider);
Пример #45
0
 public static void ImplWriteTo(IGeneratedStore s, ConfigProvider provider) => FindImpl(s).WriteTo(provider);
Пример #46
0
        protected override (CommandLineApplication, Func <IConfigProvider>, Func <string>) BuildCommandLineApp()
        {
            var pluginsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plugins");

            if (Directory.Exists(pluginsDirectory))
            {
                var plugins = Directory.GetFiles(pluginsDirectory, "*.dll");
                foreach (var plugin in plugins)
                {
                    var pluginName = plugin.Contains("/") ? plugin.Split("/").Last() : plugin.Split("\\").Last();
                    if (Logger.IsInfo)
                    {
                        Logger.Info($"Loading an external assembly: {pluginName}");
                    }
                    AssemblyLoadContext.Default.LoadFromAssemblyPath(plugin);
                }
            }

            var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();

            loadedAssemblies
            .SelectMany(x => x.GetReferencedAssemblies())
            .Distinct()
            .Where(y => loadedAssemblies.Any((a) => a.FullName == y.FullName) == false)
            .ToList()
            .ForEach(x => loadedAssemblies.Add(AppDomain.CurrentDomain.Load(x)));

            var configurationType = typeof(IConfig);
            var configs           = AppDomain.CurrentDomain.GetAssemblies()
                                    .SelectMany(a => a.GetTypes())
                                    .Where(t => configurationType.IsAssignableFrom(t) && !t.IsInterface)
                                    .ToList();

            var app = new CommandLineApplication {
                Name = "Nethermind.Runner"
            };

            app.HelpOption("-?|-h|--help");
            var configFile       = app.Option("-c|--config <configFile>", "config file path", CommandOptionType.SingleValue);
            var dbBasePath       = app.Option("-d|--baseDbPath <baseDbPath>", "base db path", CommandOptionType.SingleValue);
            var logLevelOverride = app.Option("-l|--log <logLevel>", "log level", CommandOptionType.SingleValue);

            foreach (Type configType in configs)
            {
                foreach (PropertyInfo propertyInfo in configType.GetProperties(BindingFlags.Public | BindingFlags.Instance))
                {
                    app.Option($"--{configType.Name.Replace("Config", String.Empty)}.{propertyInfo.Name}", $"{configType.Name}.{propertyInfo.Name}", CommandOptionType.SingleValue);
                }
            }

            IConfigProvider BuildConfigProvider()
            {
                // TODO: dynamically switch log levels from CLI!
                if (logLevelOverride.HasValue())
                {
                    string        logLevel  = logLevelOverride.Value();
                    NLog.LogLevel nLogLevel = NLog.LogLevel.Info;
                    switch (logLevel.ToUpperInvariant())
                    {
                    case "OFF":
                        nLogLevel = NLog.LogLevel.Off;
                        break;

                    case "ERROR":
                        nLogLevel = NLog.LogLevel.Error;
                        break;

                    case "WARN":
                        nLogLevel = NLog.LogLevel.Warn;
                        break;

                    case "INFO":
                        nLogLevel = NLog.LogLevel.Info;
                        break;

                    case "DEBUG":
                        nLogLevel = NLog.LogLevel.Debug;
                        break;

                    case "TRACE":
                        nLogLevel = NLog.LogLevel.Trace;
                        break;
                    }

                    Console.WriteLine($"Enabling log level override: {logLevel.ToUpperInvariant()}");

                    foreach (var rule in LogManager.Configuration.LoggingRules)
                    {
                        rule.DisableLoggingForLevels(NLog.LogLevel.Trace, nLogLevel);
                        rule.EnableLoggingForLevels(nLogLevel, NLog.LogLevel.Off);
                    }

                    //Call to update existing Loggers created with GetLogger() or //GetCurrentClassLogger()
                    LogManager.ReconfigExistingLoggers();
                }

                ConfigProvider configProvider    = new ConfigProvider();
                Dictionary <string, string> args = new Dictionary <string, string>();

                foreach (CommandOption commandOption in app.Options)
                {
                    if (commandOption.HasValue())
                    {
                        args.Add(commandOption.LongName, commandOption.Value());
                    }
                }

                IConfigSource argsSource = new ArgsConfigSource(args);

                configProvider.AddSource(argsSource);
                configProvider.AddSource(new EnvConfigSource());

                string configFilePath     = configFile.HasValue() ? configFile.Value() : _defaultConfigFile;
                var    configPathVariable = Environment.GetEnvironmentVariable("NETHERMIND_CONFIG");

                if (!string.IsNullOrWhiteSpace(configPathVariable))
                {
                    configFilePath = configPathVariable;
                }

                if (!Path.HasExtension(configFilePath) && !configFilePath.Contains(Path.DirectorySeparatorChar))
                {
                    string redirectedConfigPath = Path.Combine("configs", string.Concat(configFilePath, ".cfg"));
                    Console.WriteLine($"Redirecting config {configFilePath} to {redirectedConfigPath}");
                    configFilePath = redirectedConfigPath;
                }

                Console.WriteLine($"Reading config file from {configFilePath}");
                configProvider.AddSource(new JsonConfigSource(configFilePath));
                return(configProvider);
            }

            string GetBaseDbPath()
            {
                return(dbBasePath.HasValue() ? dbBasePath.Value() : null);
            }

            return(app, BuildConfigProvider, GetBaseDbPath);
        }
Пример #47
0
 public GuestModifierContext(ConfigProvider configProvider)
 {
     ConfigProvider = configProvider;
 }
Пример #48
0
 /// <summary>
 /// Returns the list of platform names supported by the current WiX project.
 /// </summary>
 /// <param name="celt">Specifies the requested number of platform names. If this number is unknown, celt can be zero.</param>
 /// <param name="names">On input, an allocated array to hold the number of platform names specified by celt. This parameter can also be a null reference if the celt parameter is zero. On output, names contains platform names.</param>
 /// <param name="actual">The actual number of platform names returned.</param>
 /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
 public override int GetPlatformNames(uint celt, string[] names, uint[] actual)
 {
     string[] platforms = this.GetPlatforms();
     return(ConfigProvider.GetPlatforms(celt, names, actual, platforms));
 }
Пример #49
0
 public XbmcProvider(ConfigProvider configProvider, HttpProvider httpProvider, EventClientProvider eventClientProvider)
 {
     _configProvider = configProvider;
     _httpProvider = httpProvider;
     _eventClientProvider = eventClientProvider;
 }
Пример #50
0
 /// <summary>
 /// Gets the list of supported platform names for WiX projects.
 /// </summary>
 /// <param name="celt">Specifies the requested number of supported platform names. If this number is unknown, celt can be zero.</param>
 /// <param name="names">On input, an allocated array to hold the number of names specified by celt. This parameter can also be a null reference (Nothing in Visual Basic)if the celt parameter is zero. On output, names contains the names of supported platforms</param>
 /// <param name="actual">The actual number of platform names returned.</param>
 /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
 public override int GetSupportedPlatformNames(uint celt, string[] names, uint[] actual)
 {
     string[] supportedPlatforms = new string[] { WixProjectConfig.X86Platform, WixProjectConfig.X64Platform, WixProjectConfig.IA64Platform };
     return(ConfigProvider.GetPlatforms(celt, names, actual, supportedPlatforms));
 }
        public async Task RunExample(string[] args)
        {
            _configProvider = new ConfigProvider(args);
            _bitmovinApi    = BitmovinApi.Builder
                              .WithApiKey(_configProvider.GetBitmovinApiKey())
                              .WithLogger(new ConsoleLogger())
                              .Build();

            var encoding = await CreateEncoding("Live encoding example", "Live encoding with RTMP input");

            var input = await GetRtmpInput();

            var inputFilePath = "live";

            var output = await CreateS3Output(_configProvider.GetS3OutputBucketName(),
                                              _configProvider.GetS3OutputAccessKey(),
                                              _configProvider.GetS3OutputSecretKey());

            // Add an H.264 video stream to the encoding
            var h264VideoConfig = await CreateH264VideoConfiguration();

            var h264VideoStream = await CreateStream(encoding, input, inputFilePath, h264VideoConfig, 0);

            // Add an AAC audio stream to the encoding
            var aacConfig = await CreateAacAudioConfiguration();

            var aacAudioStream = await CreateStream(encoding, input, inputFilePath, aacConfig, 1);

            await CreateFmp4Muxing(encoding, output, $"/video/${h264VideoConfig.Height}p", h264VideoStream);
            await CreateFmp4Muxing(encoding, output, $"/audio/${aacConfig.Bitrate! / 1000}kbs", aacAudioStream);

            var dashManifest = await CreateDefaultDashManifest(encoding, output, "/");

            var hlsManifest = await CreateDefaultHlsManifest(encoding, output, "/");

            var liveDashManifest = new LiveDashManifest()
            {
                ManifestId = dashManifest.Id
            };

            var liveHlsManifest = new LiveHlsManifest()
            {
                ManifestId = hlsManifest.Id
            };

            var startLiveEncodingRequest = new StartLiveEncodingRequest()
            {
                DashManifests = new List <LiveDashManifest>()
                {
                    liveDashManifest
                },
                HlsManifests = new List <LiveHlsManifest>()
                {
                    liveHlsManifest
                },
                StreamKey = StreamKey
            };

            await StartLiveEncodingAndWaitUntilRunning(encoding, startLiveEncodingRequest);

            var liveEncoding = await WaitForLiveEncodingDetails(encoding);

            Console.WriteLine("Live encoding is up and ready for ingest. " +
                              $"RTMP URL: rtmp://{liveEncoding.EncoderIp}/live StreamKey: {liveEncoding.StreamKey}");

            /*
             * This will enable you to shut down the live encoding from within your script.
             * In production, it is naturally recommended to stop the encoding by using the Bitmovin dashboard
             * or an independent API call - https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsLiveStopByEncodingId
             */
            Console.WriteLine("Press any key to shutdown the live encoding...");
            Console.ReadKey();

            Console.WriteLine("Shutting down live encoding.");
            await _bitmovinApi.Encoding.Encodings.Live.StopAsync(encoding.Id);

            await WaitUntilEncodingIsInState(encoding, Status.FINISHED);
        }
Пример #52
0
 public PostDownloadScanJob(PostDownloadProvider postDownloadProvider, ConfigProvider configProvider, DiskProvider diskProvider)
 {
     _postDownloadProvider = postDownloadProvider;
     _configProvider       = configProvider;
     _diskProvider         = diskProvider;
 }
Пример #53
0
        public async Task RunExample(string[] args)
        {
            _configProvider = new ConfigProvider(args);
            _bitmovinApi    = BitmovinApi.Builder
                              .WithApiKey(_configProvider.GetBitmovinApiKey())
                              // uncomment the following line if you are working with a multi-tenant account
                              // .WithTenantOrgIdKey(_configProvider.GetBitmovinTenantOrgId())
                              .WithLogger(new ConsoleLogger())
                              .Build();

            var encoding = await CreateEncoding("Audio Mapping - Stream Mapping - Multiple Mono Tracks",
                                                "Input with multiple mono tracks -> Output with stereo and surround tracks");

            var input = await CreateHttpInput(_configProvider.GetHttpInputHost());

            var output = await CreateS3Output(_configProvider.GetS3OutputBucketName(),
                                              _configProvider.GetS3OutputAccessKey(),
                                              _configProvider.GetS3OutputSecretKey());

            var h264Config = await CreateH264VideoConfiguration();

            var aacConfig = await CreateAacAudioConfiguration();

            var ddConfig = await CreateDdSurroundAudioConfiguration();

            var inputFilePath          = _configProvider.GetHttpInputFilePathWithMultipleMonoAudioTracks();
            var videoIngestInputStream = await CreateIngestInputStream(encoding, input, inputFilePath);

            var stereoMap = new List <ChannelMappingConfiguration>()
            {
                new(AudioMixChannelType.FRONT_LEFT, 0),
                new(AudioMixChannelType.FRONT_RIGHT, 1)
            };
            var surroundMap = new List <ChannelMappingConfiguration>()
            {
                new(AudioMixChannelType.FRONT_LEFT, 2),
                new(AudioMixChannelType.FRONT_RIGHT, 3),
                new(AudioMixChannelType.BACK_LEFT, 4),
                new(AudioMixChannelType.BACK_RIGHT, 5),
                new(AudioMixChannelType.CENTER, 6),
                new(AudioMixChannelType.LOW_FREQUENCY, 7),
            };

            var stereoAudioMixStreams =
                await CreateAudioMixInputStreamChannels(encoding, input, inputFilePath, stereoMap);

            var stereoMixInputStream =
                await CreateAudioMixInputStream(encoding, AudioMixInputChannelLayout.CL_STEREO, stereoAudioMixStreams);

            var surroundAudioMixStreams =
                await CreateAudioMixInputStreamChannels(encoding, input, inputFilePath, surroundMap);

            var surroundMixInputStream = await CreateAudioMixInputStream(
                encoding, AudioMixInputChannelLayout.CL_5_1_BACK, surroundAudioMixStreams);

            var videoStream = await CreateStream(encoding, videoIngestInputStream, h264Config);

            var stereoAudioStream = await CreateStream(encoding, stereoMixInputStream, aacConfig);

            var surroundAudioStream = await CreateStream(encoding, surroundMixInputStream, ddConfig);

            await CreateMp4Muxing(
                encoding,
                output,
                "/",
                new List <Stream>() { videoStream, stereoAudioStream, surroundAudioStream },
                "stereo-and-surround-tracks-mapped.mp4");

            await ExecuteEncoding(encoding);
        }
        public async Task RunExample(string[] args)
        {
            _configProvider = new ConfigProvider(args);
            _bitmovinApi    = BitmovinApi.Builder
                              .WithApiKey(_configProvider.GetBitmovinApiKey())
                              // uncomment the following line if you are working with a multi-tenant account
                              // .WithTenantOrgIdKey(_configProvider.GetBitmovinTenantOrgId())
                              .WithLogger(new ConsoleLogger())
                              .Build();

            var encoding = await CreateEncoding("Encoding with SSAI",
                                                "Encoding Example - SSAI conditioned HLS streams");

            var input = await CreateHttpInput(_configProvider.GetHttpInputHost());

            var inputFilePath = _configProvider.GetHttpInputFilePath();

            var output = await CreateS3Output(_configProvider.GetS3OutputBucketName(),
                                              _configProvider.GetS3OutputAccessKey(),
                                              _configProvider.GetS3OutputSecretKey());

            var videoConfigurations = new List <H264VideoConfiguration>()
            {
                await CreateH264VideoConfiguration(1080, 4_800_000),
                await CreateH264VideoConfiguration(720, 2_400_000),
                await CreateH264VideoConfiguration(480, 1_200_000),
                await CreateH264VideoConfiguration(360, 800_000),
                await CreateH264VideoConfiguration(240, 400_000)
            };

            // create a stream and fMP4 muxing for each video codec configuration
            var videoMuxings = new Dictionary <VideoConfiguration, Fmp4Muxing>();

            foreach (var videoConfig in videoConfigurations)
            {
                var videoStream = await CreateStream(encoding, input, inputFilePath, videoConfig);

                var muxing = await CreateFmp4Muxing(encoding, output, $"video/{videoConfig.Height}", videoStream);

                videoMuxings[videoConfig] = muxing;
            }

            // create a stream and fMP4 muxing for audio
            var aacConfig = await CreateAacAudioConfiguration();

            var aacAudioStream = await CreateStream(encoding, input, inputFilePath, aacConfig);

            var aacAudioMuxing = await CreateFmp4Muxing(encoding, output, "audio", aacAudioStream);

            // seconds in which to add a custom HLS tag for ad placement, as well as when to insert a
            // keyframe/split a segment
            var adBreakPlacements = new List <double>()
            {
                5.0, 15.0
            };

            // define keyframes that are used to insert advertisement tags into the manifest
            var keyframes = await CreateKeyframes(encoding, adBreakPlacements);

            await ExecuteEncoding(encoding);

            // create the master manifest that references audio and video playlists
            var manifestHls = await CreateHlsMasterManifest(output, "/");

            // create an audio playlist and provide it with custom tags for ad-placement
            var audioMediaInfo = await CreateAudioMediaPlaylist(encoding, manifestHls, aacAudioMuxing, "audio/");

            await PlaceAudioAdvertisementTags(manifestHls, audioMediaInfo, keyframes);

            // create a video playlist for each video muxing and provide it with custom tags for ad-placement
            foreach (var key in videoMuxings.Keys)
            {
                var streamInfo = await CreateVideoStreamPlaylist(
                    encoding,
                    manifestHls,
                    $"video_${key.Height}.m3u8",
                    videoMuxings[key],
                    $"video/${key.Height}",
                    audioMediaInfo
                    );
                await PlaceVideoAdvertisementTags(manifestHls, streamInfo, keyframes);
            }

            await ExecuteHlsManifestCreation(manifestHls);
        }
Пример #55
0
            /// <summary>
            ///     Get the singleton with the given config.
            /// </summary>
            /// <param name="config">The config to read</param>
            /// <remarks>This method is protected by a mutex.</remarks>
            /// <returns>The singleton</returns>
            /// <seealso cref="getInstance()"/>
            public static Handler getInstance(ConfigProvider config)
            {
                Handler instance;

                sInstanceMutex.WaitOne();
                if (sInstance == null)
                    sInstance = new Handler(config);
                else
                    sInstance.changeDefaultConfig(config);
                instance = sInstance;
                sInstanceMutex.ReleaseMutex();

                return instance;
            }
 public SceneMappingProvider(IDatabase database, HttpProvider httpProvider, ConfigProvider configProvider)
 {
     _database       = database;
     _httpProvider   = httpProvider;
     _configProvider = configProvider;
 }
Пример #57
0
            /// <summary>
            ///     Load a new config in the default shortcut list.
            /// </summary>
            /// <param name="config">The config to load</param>
            private void changeDefaultConfig(ConfigProvider config)
            {
                resetShortcuts();

                mDefaultShortcutsList.Clear();
                setDefaultConfig(config);

                loadShortcuts();
            }
Пример #58
0
 public SmtpProvider(ConfigProvider configProvider)
 {
     _configProvider = configProvider;
 }
Пример #59
0
 public AnalyticsProvider(IDeskMetricsClient deskMetricsClient, ConfigProvider configProvider)
 {
     _deskMetricsClient = deskMetricsClient;
     _configProvider = configProvider;
 }
Пример #60
0
 public MockIndexer(HttpProvider httpProvider, ConfigProvider configProvider)
     : base(httpProvider, configProvider)
 {
 }