From 0ece2fd6e0eb01e0b7d4d2a01e1a276c7a9c5a51 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 14 Jan 2022 10:09:50 +0000 Subject: [PATCH] fix(email-notifications): :bug: Fixed the issue where legacy requests were showing broken poster images #4452 --- .../NotificationMessageCurlys.cs | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index 8023ae464..924864c62 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -43,7 +43,17 @@ namespace Ombi.Notifications var img = req?.PosterPath ?? string.Empty; if (img.HasValue()) { - PosterImage = $"https://image.tmdb.org/t/p/w300/{req?.PosterPath?.TrimStart('/') ?? string.Empty}"; + if (img.StartsWith("http")) + { + // This means it's a legacy request from when we used TvMaze as a provider. + // The poster url is the fully qualified address, so just use it + PosterImage = img; + } + else + { + PosterImage = + $"https://image.tmdb.org/t/p/w300/{img?.TrimStart('/') ?? string.Empty}"; + } } CalculateRequestStatus(req); } @@ -61,8 +71,17 @@ namespace Ombi.Notifications var img = req?.ParentRequest?.PosterPath ?? string.Empty; if (img.HasValue()) { - PosterImage = - $"https://image.tmdb.org/t/p/w300/{req?.ParentRequest?.PosterPath?.TrimStart('/') ?? string.Empty}"; + if (img.StartsWith("http")) + { + // This means it's a legacy request from when we used TvMaze as a provider. + // The poster url is the fully qualified address, so just use it + PosterImage = img; + } + else + { + PosterImage = + $"https://image.tmdb.org/t/p/w300/{img?.TrimStart('/') ?? string.Empty}"; + } } // Generate episode list.