From 4cdd0e5875928d30e7ee7cae079c78de535b7e14 Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 13 Jun 2018 21:44:55 +0100 Subject: [PATCH] Fixed #2312 --- .../NotificationMessageCurlys.cs | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index fb5dd976b..dce0ce482 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -44,8 +44,17 @@ namespace Ombi.Notifications } Overview = req?.Overview; Year = req?.ReleaseDate.Year.ToString(); - PosterImage = req?.RequestType == RequestType.Movie ? - string.Format("https://image.tmdb.org/t/p/w300{0}", req?.PosterPath) : req?.PosterPath; + + if (req?.RequestType == RequestType.Movie) + { + PosterImage = string.Format((req?.PosterPath ?? string.Empty).StartsWith("/", StringComparison.InvariantCultureIgnoreCase) + ? "https://image.tmdb.org/t/p/w300{0}" : "https://image.tmdb.org/t/p/w300/{0}", req?.PosterPath); + } + else + { + PosterImage = req?.PosterPath; + } + AdditionalInformation = opts?.AdditionalInformation ?? string.Empty; } @@ -88,8 +97,15 @@ namespace Ombi.Notifications Overview = req?.ParentRequest.Overview; Year = req?.ParentRequest.ReleaseDate.Year.ToString(); - PosterImage = req?.RequestType == RequestType.Movie ? - $"https://image.tmdb.org/t/p/w300{req?.ParentRequest.PosterPath}" : req?.ParentRequest.PosterPath; + if (req?.RequestType == RequestType.Movie) + { + PosterImage = string.Format((req?.ParentRequest.PosterPath ?? string.Empty).StartsWith("/", StringComparison.InvariantCultureIgnoreCase) + ? "https://image.tmdb.org/t/p/w300{0}" : "https://image.tmdb.org/t/p/w300/{0}", req?.ParentRequest.PosterPath); + } + else + { + PosterImage = req?.ParentRequest.PosterPath; + } AdditionalInformation = opts.AdditionalInformation; // DO Episode and Season Lists