浏览代码

retry failed recordings

Luke Pulverenti 9 年之前
父节点
当前提交
de8bf2b396
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

+ 6 - 3
MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

@@ -482,10 +482,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
             {
                 _logger.ErrorException("Error recording stream", ex);
 
-                const int retryIntervalSeconds = 60;
-                _logger.Debug("Retrying recording in {0} seconds.", retryIntervalSeconds);
+                if (DateTime.UtcNow < timer.EndDate)
+                {
+                    const int retryIntervalSeconds = 60;
+                    _logger.Debug("Retrying recording in {0} seconds.", retryIntervalSeconds);
 
-                _timerProvider.StartTimer(timer, TimeSpan.FromSeconds(retryIntervalSeconds));
+                    _timerProvider.StartTimer(timer, TimeSpan.FromSeconds(retryIntervalSeconds));
+                }
             }
         }