Beispiel #1
0
        public StreamingSettings GetVlcSettings()
        {
            var settings = new StreamingSettings();

            settings.Host       = Host;
            settings.StreamPort = VlcPort;
            settings.Password   = VlcPassword;
            settings.UseQSV     = VlcUseQSV;
            settings.PresetHigh();

            return(settings);
        }
Beispiel #2
0
 // can not inject IRepository<T> directly, because IRepository<T> is scoped,
 // while BackgroundService is singleton, have to use IServiceScopeFactory to generate a scope
 public CleanService(
     IOptionsSnapshot <StreamingSettings> streamingOptions,
     IOptionsSnapshot <AppCleanSettings> appCleanOptions,
     IOptionsSnapshot <ChatCleanSettings> chatCleanOptions,
     IServiceScopeFactory serviceScopeFactory,
     ILogger <CleanService> logger)
 {
     _streamingSettings   = streamingOptions?.Value ?? throw new ArgumentNullException(nameof(streamingOptions));
     _appCleanSettings    = appCleanOptions?.Value ?? throw new ArgumentNullException(nameof(appCleanOptions));
     _chatCleanSettings   = chatCleanOptions?.Value ?? throw new ArgumentNullException(nameof(chatCleanOptions));
     _serviceScopeFactory = serviceScopeFactory ?? throw new ArgumentNullException(nameof(serviceScopeFactory));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }