Browse Source

Skip image processing for live tv sources

Bill Thornton 5 năm trước cách đây
mục cha
commit
2fa2952791
1 tập tin đã thay đổi với 46 bổ sung42 xóa
  1. 46 42
      Emby.Server.Implementations/Library/LibraryManager.cs

+ 46 - 42
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -1882,59 +1882,63 @@ namespace Emby.Server.Implementations.Library
                 return;
             }
 
-            foreach (var img in outdated)
+            // Skip image processing for live tv
+            if (item.SourceType == SourceType.Library)
             {
-                var image = img;
-                if (!img.IsLocalFile)
+                foreach (var img in outdated)
                 {
-                    try
+                    var image = img;
+                    if (!img.IsLocalFile)
                     {
-                        var index = item.GetImageIndex(img);
-                        image = ConvertImageToLocal(item, img, index).ConfigureAwait(false).GetAwaiter().GetResult();
+                        try
+                        {
+                            var index = item.GetImageIndex(img);
+                            image = ConvertImageToLocal(item, img, index).ConfigureAwait(false).GetAwaiter().GetResult();
+                        }
+                        catch (ArgumentException)
+                        {
+                            _logger.LogWarning("Cannot get image index for {0}", img.Path);
+                            continue;
+                        }
+                        catch (InvalidOperationException)
+                        {
+                            _logger.LogWarning("Cannot fetch image from {0}", img.Path);
+                            continue;
+                        }
                     }
-                    catch (ArgumentException)
+
+                    try
                     {
-                        _logger.LogWarning("Cannot get image index for {0}", img.Path);
-                        continue;
+                        ImageDimensions size = _imageProcessor.GetImageDimensions(item, image);
+                        image.Width = size.Width;
+                        image.Height = size.Height;
                     }
-                    catch (InvalidOperationException)
+                    catch (Exception ex)
                     {
-                        _logger.LogWarning("Cannot fetch image from {0}", img.Path);
+                        _logger.LogError(ex, "Cannnot get image dimensions for {0}", image.Path);
+                        image.Width = 0;
+                        image.Height = 0;
                         continue;
                     }
-                }
-
-                try
-                {
-                    ImageDimensions size = _imageProcessor.GetImageDimensions(item, image);
-                    image.Width = size.Width;
-                    image.Height = size.Height;
-                }
-                catch (Exception ex)
-                {
-                    _logger.LogError(ex, "Cannnot get image dimensions for {0}", image.Path);
-                    image.Width = 0;
-                    image.Height = 0;
-                    continue;
-                }
 
-                try
-                {
-                    image.BlurHash = _imageProcessor.GetImageBlurHash(image.Path);
-                }
-                catch (Exception ex)
-                {
-                    _logger.LogError(ex, "Cannot compute blurhash for {0}", image.Path);
-                    image.BlurHash = string.Empty;
-                }
+                    try
+                    {
+                        image.BlurHash = _imageProcessor.GetImageBlurHash(image.Path);
+                    }
+                    catch (Exception ex)
+                    {
+                        _logger.LogError(ex, "Cannot compute blurhash for {0}", image.Path);
+                        image.BlurHash = string.Empty;
+                    }
 
-                try
-                {
-                    image.DateModified = _fileSystem.GetLastWriteTimeUtc(image.Path);
-                }
-                catch (Exception ex)
-                {
-                    _logger.LogError(ex, "Cannot update DateModified for {0}", image.Path);
+                    try
+                    {
+                        image.DateModified = _fileSystem.GetLastWriteTimeUtc(image.Path);
+                    }
+                    catch (Exception ex)
+                    {
+                        _logger.LogError(ex, "Cannot update DateModified for {0}", image.Path);
+                    }
                 }
             }