From f4fa835db01fde6087d1d5af5028bfcabcb77fc2 Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Thu, 16 May 2019 13:28:37 +0100 Subject: [PATCH] Fixed #2950 --- src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs index 84798cc61..f3756bb0f 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs @@ -364,7 +364,7 @@ namespace Ombi.Schedule.Jobs.Ombi if (embySettings.Enable) { - await ProcessEmbyMovies(embyMovies, sb, ombiSettings.DefaultLanguageCode); + await ProcessEmbyMovies(embyMovies, sb, ombiSettings.DefaultLanguageCode, embySettings.Servers.FirstOrDefault()?.ServerHostname ?? string.Empty); } sb.Append(""); @@ -390,7 +390,7 @@ namespace Ombi.Schedule.Jobs.Ombi if (embySettings.Enable) { - await ProcessEmbyTv(embyEp, sb); + await ProcessEmbyTv(embyEp, sb, embySettings.Servers.FirstOrDefault()?.ServerHostname ?? string.Empty); } sb.Append(""); @@ -495,7 +495,7 @@ namespace Ombi.Schedule.Jobs.Ombi } } - private async Task ProcessEmbyMovies(IQueryable embyContent, StringBuilder sb, string defaultLangaugeCode) + private async Task ProcessEmbyMovies(IQueryable embyContent, StringBuilder sb, string defaultLangaugeCode, string customUrl) { int count = 0; var ordered = embyContent.OrderByDescending(x => x.AddedAt); @@ -516,6 +516,10 @@ namespace Ombi.Schedule.Jobs.Ombi } var mediaurl = content.Url; + if (customUrl.HasValue()) + { + mediaurl = customUrl; + } var info = await _movieApi.GetMovieInformationWithExtraInfo(StringHelper.IntParseLinq(theMovieDbId), defaultLangaugeCode); if (info == null) { @@ -759,7 +763,7 @@ namespace Ombi.Schedule.Jobs.Ombi - private async Task ProcessEmbyTv(HashSet embyContent, StringBuilder sb) + private async Task ProcessEmbyTv(HashSet embyContent, StringBuilder sb, string serverUrl) { var series = new List(); foreach (var episode in embyContent) @@ -814,7 +818,7 @@ namespace Ombi.Schedule.Jobs.Ombi AddBackgroundInsideTable(sb, $"https://image.tmdb.org/t/p/w1280/"); } AddPosterInsideTable(sb, banner); - AddMediaServerUrl(sb, t.Url, banner); + AddMediaServerUrl(sb, serverUrl.HasValue() ? serverUrl : t.Url, banner); AddInfoTable(sb); var title = "";