Skip to content

Commit

Permalink
fix(email-notifications): 🐛 Fixed the issue where legacy requests wer…
Browse files Browse the repository at this point in the history
…e showing broken poster images #4452
  • Loading branch information
tidusjar committed Jan 14, 2022
1 parent 9fe1f8e commit 0ece2fd
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/Ombi.Notifications/NotificationMessageCurlys.cs
Expand Up @@ -43,7 +43,17 @@ public void Setup(OmbiUser user, CustomizationSettings s)
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);
}
Expand All @@ -61,8 +71,17 @@ public void Setup(OmbiUser user, CustomizationSettings s)
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.
Expand Down

0 comments on commit 0ece2fd

Please sign in to comment.