Skip to content

Commit

Permalink
Fixed #2312
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Jun 13, 2018
1 parent d1e78b2 commit 4cdd0e5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/Ombi.Notifications/NotificationMessageCurlys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ public void Setup(NotificationOptions opts, FullBaseRequest req, CustomizationSe
}
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;
}

Expand Down Expand Up @@ -88,8 +97,15 @@ public void Setup(NotificationOptions opts, ChildRequests req, CustomizationSett

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

Expand Down

0 comments on commit 4cdd0e5

Please sign in to comment.