private void RefreshChannelInfo(object sender, ElapsedEventArgs e)
 {
     try
     {
         if (_apiLink != null)
         {
             ChannelInfo = _apiLink.GetChannelInfo();
             ViewersEvolution.Add(ChannelInfo.Viewers);
             if (ChannelInfo.Viewers > ViewersPeak)
             {
                 ViewersPeak = ChannelInfo.Viewers;
             }
         }
         if (!IsInitialized)
         {
             IsInitialized = true;
             Log.Info("Module succesfully initialized");
         }
         _refreshChannelInfo.Start();
     }
     catch (Exception ex)
     {
         Log.Error(ex, "An error occured when trying to refresh channel info : ");
         IsConfigured = false;
     }
 }
Example #2
0
        private void RefreshChannelInfo(object sender, ElapsedEventArgs e)
        {
            if (_apiLink != null)
            {
                ChannelInfo = _apiLink.GetChannelInfo();
                if (ChannelInfo.Viewers > ViewersPeak)
                {
                    ViewersPeak = ChannelInfo.Viewers;
                }

                if (string.IsNullOrEmpty(EditName))
                {
                    EditName = ChannelInfo.Title;
                }
                if (string.IsNullOrEmpty(EditGame?.Name))
                {
                    EditGame = ChannelInfo.Game;
                }
            }
            _refreshInfo.Start();
        }