public async void RefreshConfigData(bool isConfigChange, CancellationToken cancellationToken) { var config = Plugin.Instance.Configuration; if (config.TunerHostsConfiguration != null) { _tunerServer = TunerHostFactory.CreateTunerHosts(config.TunerHostsConfiguration, _logger, _jsonSerializer, _httpClient); for (var i = 0; i < _tunerServer.Count(); i++) { try { await _tunerServer[i].GetDeviceInfo(cancellationToken); config.TunerHostsConfiguration[i].ServerId = _tunerServer[i].HostId; } catch (Exception exception) { _logger.ErrorException("Error getting device info", exception); } } } Plugin.Instance.SaveConfiguration(); if (isConfigChange) { await AddLineupIfNeeded(config, cancellationToken).ConfigureAwait(false); } }
public async void RefreshConfigData(CancellationToken cancellationToken) { var config = Plugin.Instance.Configuration; if (config.TunerHostsConfiguration != null) { _tunerServer = TunerHostFactory.CreateTunerHosts(config.TunerHostsConfiguration, _logger, _jsonSerializer, _httpClient); for (var i = 0; i < _tunerServer.Count(); i++) { await _tunerServer[i].GetDeviceInfo(cancellationToken); config.TunerHostsConfiguration[i].ServerId = _tunerServer[i].HostId; } } if (FirstRun) { seriesTimers = GetSeriesTimerData(DataPath, _xmlSerializer); InitializeTimer(GetTimerData(DataPath, _xmlSerializer)); } FirstRun = false; _tvGuide = new EPGProvider.SchedulesDirect(config.username, config.hashPassword, config.lineup, _logger, _jsonSerializer, _httpClient); config.avaliableLineups = await _tvGuide.getLineups(cancellationToken); if (_tvGuide.badPassword) { config.hashPassword = ""; } config.headends = await _tvGuide.getHeadends(config.zipCode, cancellationToken); Plugin.Instance.SaveConfiguration(); }
public async void RefreshConfigData(bool isConfigChange, CancellationToken cancellationToken) { var config = Plugin.Instance.Configuration; if (config.TunerHostsConfiguration != null) { _tunerServer = TunerHostFactory.CreateTunerHosts(config.TunerHostsConfiguration, _logger, _jsonSerializer, _httpClient); for (var i = 0; i < _tunerServer.Count(); i++) { await _tunerServer[i].GetDeviceInfo(cancellationToken); config.TunerHostsConfiguration[i].ServerId = _tunerServer[i].HostId; } } Plugin.Instance.SaveConfiguration(); }