public void CheckRecordingStatus(CancellationToken cancellationToken)
        {
            var schedules        = Plugin.TvProxy.GetCurrentSchedules(cancellationToken);
            int currentSchedules = schedules.Sum(s => s.Id) * schedules.Sum(s => s.ScheduleType) * schedules.Sum(s => s.PreRecordInterval) * schedules.Sum(s => s.PostRecordInterval);

            if (currentSchedules != lastSchedules)
            {
                Plugin.Logger.Info("Changes of timers at TVServer detected. Refreshing timers now.");
                RefreshTimers(cancellationToken);
                RefreshSeriesTimers(cancellationToken);
                lastSchedules = currentSchedules;
            }

            int currentRecordingCount = Plugin.TvProxy.GetRecordingCount(cancellationToken);

            if (currentRecordingCount != lastRecordingCount)
            {
                RecordingStatusChangedEventArgs args = new RecordingStatusChangedEventArgs();
                args.NewStatus = RecordingStatus.New;

                Plugin.Logger.Info("Changes of recordings at TVServer detected. Refreshing recordings now.");
                RecordingStatusChanged?.Invoke(this, args);
                lastRecordingCount = currentRecordingCount;
            }
        }
Пример #2
0
 public void sendRecordingStatusChanged(RecordingStatusChangedEventArgs recordingStatusChangedEventArgs)
 {
     try
     {
         _logger.Fatal("[TVHclient] sendRecordingStatusChanged 1");
         if (RecordingStatusChanged != null)
         {
             _logger.Fatal("[TVHclient] sendRecordingStatusChanged 2");
             RecordingStatusChanged(this, recordingStatusChangedEventArgs);
         }
     }
     catch (Exception ex)
     {
         _logger.Error("[TVHclient] LiveTvService.sendRecordingStatusChanged caught exception: " + ex.Message);
     }
 }
 public void sendRecordingStatusChanged(RecordingStatusChangedEventArgs recordingStatusChangedEventArgs)
 {
     try
     {
         if (RecordingStatusChanged != null)
         {
             _logger.LogDebug("[TVHclient] LiveTvService.sendRecordingStatusChanged: recording status changed");
             RecordingStatusChanged(this, recordingStatusChangedEventArgs);
         }
         else
         {
             _logger.LogCritical("[TVHclient] LiveTvServicesendRecordingStatusChanged: EventHandler 'RecordingStatusChanged' was not set by Jellyfin");
         }
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "[TVHclient] LiveTvService.sendRecordingStatusChanged: exception caught");
     }
 }
 public void sendRecordingStatusChanged(RecordingStatusChangedEventArgs recordingStatusChangedEventArgs)
 {
     try
     {
         _logger.LogCritical("[TVHclient] sendRecordingStatusChanged 1");
         if (RecordingStatusChanged != null)
         {
             _logger.LogCritical("[TVHclient] sendRecordingStatusChanged 2");
             RecordingStatusChanged(this, recordingStatusChangedEventArgs);
         }
         else
         {
             _logger.LogCritical("[TVHclient] sendRecordingStatusChanged called but EventHandler 'RecordingStatusChanged' was not set by Emby!!!");
         }
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "[TVHclient] LiveTvService.sendRecordingStatusChanged caught exception");
     }
 }
 private void AudioRecorder_RecordingStatusChanged(object sender, RecordingStatusChangedEventArgs e)
 {
     //Console.WriteLine("[AudioRecorder_RecordingStatusChanged] ElapsedTime:" + e.ElapsedTime + ", FileSize:" + e.FileSize);
 }
 private void OnRecordingStatusChanged(object sender, RecordingStatusChangedEventArgs e)
 {
     // TODO: Insert code to handle the recording status changes.
     // Logger.Info($"Elapsed time: {e.ElapsedTime} ms, file size: {e.FileSize} kb");
 }