changed overlay picture to poster pic so we have fallback styling on older clients

pull/2191/head
Anojh 7 years ago
parent ff79363336
commit 37a5759a32

@ -10,7 +10,7 @@ namespace Ombi.Schedule.Jobs.Ombi
sb.AppendFormat("<table class=\"card-bg\" style=\"background-image: url({0}); border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #1f1f1f; background-position: center; background-size: cover; background-repeat: no-repeat; background-clip: padding-box; border: 2px solid rgba(255,118,27,.4); \">", url);
sb.Append("<tr>");
sb.Append("<td>");
sb.Append("<table class=\"bg-tint\" style=\"background-color: rgba(0, 0, 0, .6); \">");
sb.Append("<table class=\"bg-tint\" style=\"background-color: rgba(0, 0, 0, .6); position: absolute; width: 490px; height: 239px; \">");
}
protected virtual void AddPosterInsideTable(StringBuilder sb, string url)
@ -20,12 +20,12 @@ namespace Ombi.Schedule.Jobs.Ombi
sb.AppendFormat("<table class=\"poster-img\" style=\"background-image: url({0}); border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: transparent; background-position: center; background-size: cover; background-repeat: no-repeat; background-clip: padding-box; border: 1px solid rgba(255,255,255,.1); \">", url);
}
protected virtual void AddMediaServerUrl(StringBuilder sb, string mediaurl, string overlay)
protected virtual void AddMediaServerUrl(StringBuilder sb, string mediaurl, string url)
{
sb.Append("<tr>");
sb.Append("<td style=\"font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; vertical-align: top; \">");
sb.AppendFormat("<a href=\"{0}\" target=\"_blank\">", mediaurl);
sb.AppendFormat("<img class=\"poster-overlay\" src=\"{0}\" width=\"150\" height=\"225\" style=\"border: none;-ms-interpolation-mode: bicubic; max-width: 100%;display: block; visibility: hidden; \">", overlay);
sb.AppendFormat("<img class=\"poster-overlay\" src=\"{0}\" width=\"150\" height=\"225\" style=\"border: none;-ms-interpolation-mode: bicubic; max-width: 100%;display: block; visibility: hidden; \">", url);
sb.Append("</a>");
sb.Append("</td>");
sb.Append("</tr>");

@ -60,7 +60,6 @@ namespace Ombi.Schedule.Jobs.Ombi
private readonly ISettingsService<NewsletterSettings> _newsletterSettings;
private readonly UserManager<OmbiUser> _userManager;
private readonly ILogger _log;
private string overlay;
public async Task Start(NewsletterSettings settings, bool test)
{
@ -347,7 +346,6 @@ namespace Ombi.Schedule.Jobs.Ombi
private async Task ProcessPlexMovies(IQueryable<PlexServerContent> plexContentToSend, StringBuilder sb)
{
int count = 0;
overlay = "https://www.plex.tv/wp-content/themes/plex/img/plex-logo@2x.png";
var ordered = plexContentToSend.OrderByDescending(x => x.AddedAt);
foreach (var content in ordered)
{
@ -388,7 +386,6 @@ namespace Ombi.Schedule.Jobs.Ombi
private async Task ProcessEmbyMovies(IQueryable<EmbyContent> embyContent, StringBuilder sb)
{
int count = 0;
overlay = "https://emby.media/resources/logowhite_1881.png";
var ordered = embyContent.OrderByDescending(x => x.AddedAt);
foreach (var content in ordered)
{
@ -440,7 +437,7 @@ namespace Ombi.Schedule.Jobs.Ombi
AddBackgroundInsideTable(sb, $"https://image.tmdb.org/t/p/w1280/{info.BackdropPath}");
AddPosterInsideTable(sb, $"https://image.tmdb.org/t/p/original{info.PosterPath}");
AddMediaServerUrl(sb, mediaurl, overlay);
AddMediaServerUrl(sb, mediaurl, $"https://image.tmdb.org/t/p/original{info.PosterPath}");
AddInfoTable(sb);
var releaseDate = string.Empty;
@ -485,7 +482,6 @@ namespace Ombi.Schedule.Jobs.Ombi
}
int count = 0;
overlay = "https://www.plex.tv/wp-content/themes/plex/img/plex-logo@2x.png";
var orderedTv = series.OrderByDescending(x => x.AddedAt);
foreach (var t in orderedTv)
{
@ -541,7 +537,7 @@ namespace Ombi.Schedule.Jobs.Ombi
AddBackgroundInsideTable(sb, $"https://image.tmdb.org/t/p/w1280/");
}
AddPosterInsideTable(sb, banner);
AddMediaServerUrl(sb, t.Url, overlay);
AddMediaServerUrl(sb, t.Url, banner);
AddInfoTable(sb);
var title = $"{t.Title} ({t.ReleaseYear})";
@ -633,7 +629,6 @@ namespace Ombi.Schedule.Jobs.Ombi
}
int count = 0;
overlay = "https://emby.media/resources/logowhite_1881.png";
var orderedTv = series.OrderByDescending(x => x.AddedAt);
foreach (var t in orderedTv)
{
@ -668,7 +663,7 @@ namespace Ombi.Schedule.Jobs.Ombi
AddBackgroundInsideTable(sb, $"https://image.tmdb.org/t/p/w1280/");
}
AddPosterInsideTable(sb, banner);
AddMediaServerUrl(sb, t.Url, overlay);
AddMediaServerUrl(sb, t.Url, banner);
AddInfoTable(sb);
AddTitle(sb, $"https://www.imdb.com/title/{info.externals.imdb}/", $"{t.Title} ({info.premiered.Remove(4)})");

Loading…
Cancel
Save