From 2fa29527918570a1b100dec5bac78bca8e41e23e Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Tue, 21 Jul 2020 16:40:38 -0400 Subject: [PATCH] Skip image processing for live tv sources --- .../Library/LibraryManager.cs | 88 ++++++++++--------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index c27b73c74e..e02213710e 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/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); + } } }