private void StreamService_Updated(object sender, ServiceUpdatedEventArgs e) { if (e.NewFollowers.HasValue) { this.FollowerClient.UpdateFollowers(StreamService.CurrentFollowerCount + e.NewFollowers.Value); } if (e.NewViewers.HasValue) { this.ViewerClient.UpdateViewers(e.ServiceName, e.NewViewers.Value); } }
private void HandleUpdate(uint channelId, WS.LivePayload data) { ServiceUpdatedEventArgs update = null; if (data.NumFollowers.HasValue && data.NumFollowers != Followers) { Followers = (int)data.NumFollowers.Value; update = update ?? new ServiceUpdatedEventArgs(); update.NewFollowers = Followers; _logger.LogTrace($"New followers count: {Followers}"); } if (data.ViewersCurrent.HasValue) { var count = (int)data.ViewersCurrent.Value; if (count != Viewers) { Viewers = count; update = update ?? new ServiceUpdatedEventArgs(); update.NewViewers = count; _logger.LogTrace($"New viewers count: {count}"); } } if (data.Online.HasValue) { update = update ?? new ServiceUpdatedEventArgs(); update.IsOnline = IsOnline = data.Online.Value; StreamStartedAt = null; // Clear cached stream start time _logger.LogTrace($"Online status changed to: {update.IsOnline}"); } if (update != null) { update.ServiceName = MixerService.SERVICE_NAME; update.ChannelId = channelId; _fireEvent(nameof(MixerService.Updated), update); } }
private void ShedulerControl_ServiceUpdated(object sender, ServiceUpdatedEventArgs e) { Document.UpdateServiceAndType(e.ServiceType, e.Service); Document.UpdateServiceTreeList(); }