From 511f1ef882d594df64810d2c36b59ad381fd6e17 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Fri, 20 Nov 2026 07:23:42 -0500 Subject: Backport pull request #18048 from jellyfin/release-12.z Follow the Schedules Direct API contract when refreshing the guide Original-merge: 85fa90cb758dabfb434fbd00c1128091007cf6a4 Merged-by: Bond-009 Backported-by: Cody Robibero --- .../Library/LibraryManager.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs') diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 2aa41f020d..359b0f1d0c 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -3769,6 +3769,7 @@ namespace Emby.Server.Implementations.Library public async Task ConvertImageToLocal(BaseItem item, ItemImageInfo image, int imageIndex, bool removeOnFailure) { + HttpRequestException? lastHttpException = null; foreach (var url in image.Path.Split('|')) { try @@ -3800,6 +3801,7 @@ namespace Emby.Server.Implementations.Library && (ex.StatusCode.Value == HttpStatusCode.NotFound || ex.StatusCode.Value == HttpStatusCode.Forbidden)) { _logger.LogDebug(ex, "Error downloading image {Url}", url); + lastHttpException = ex; continue; } @@ -3814,13 +3816,17 @@ namespace Emby.Server.Implementations.Library await item.UpdateToRepositoryAsync(ItemUpdateType.ImageUpdate, CancellationToken.None).ConfigureAwait(false); } - throw new InvalidOperationException(string.Format( - CultureInfo.InvariantCulture, - "Unable to convert any {0} image url in \"{1}\" to a local file for {2} ({3})", - image.Type, - image.Path, - item.Name, - item.Id)); + // Keep the rejection as the inner exception: callers such as the Live TV guide need the + // status code to tell a missing image from a provider that is refusing us. + throw new InvalidOperationException( + string.Format( + CultureInfo.InvariantCulture, + "Unable to convert any {0} image url in \"{1}\" to a local file for {2} ({3})", + image.Type, + image.Path, + item.Name, + item.Id), + lastHttpException); } public async Task AddVirtualFolder(string name, CollectionTypeOptions? collectionType, LibraryOptions options, bool refreshLibrary) -- cgit v1.2.3