private void OnEnableRpOfficialTrackingChange() { // USER and APP - when RP tracking is started at Startup or user enables/disables RP tracking if (_config.ExternalConfig.EnableRpOfficialTracking) { _config.State.RpTrackingConfig.Players = _apihandler.GetSync_v2().Players; } else { if (_config.ExternalConfig.Channel == 99 && !(_foobar2000Watcher.CheckPlayerState(out bool channelChanged) && channelChanged) && !(_musicBeeWatcher.CheckPlayerState(out bool channelChangedM) && channelChangedM)) { _config.ExternalConfig.Channel = 0; } _config.State.RpTrackingConfig.Players = _apihandler.GetSync_v2().Players; _config.State.RpTrackingConfig.ActivePlayerId = null; _config.State.RpTrackingConfig.Players = new List <Player>(); } }
public void CheckTrackedRpPlayerStatus() { _log.Information(LogHelper.GetMethodName(this), $"{_config.ExternalConfig.EnableRpOfficialTracking}"); if (_config.ExternalConfig.EnableRpOfficialTracking) { _log.Information(LogHelper.GetMethodName(this), "Refresh available players"); _config.State.RpTrackingConfig.Players = _apiHandler.GetSync_v2().Players; if (_config.IsRpPlayerTrackingChannel(out int trackedChannel) && _config.ExternalConfig.Channel != trackedChannel) { _log.Information(LogHelper.GetMethodName(this), $"Tracking is active - Tracked channel: {trackedChannel}"); _config.ExternalConfig.Channel = trackedChannel; } } }