From 8a55de2b71b5472fccabd1bcb842ea140095f871 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 30 Mar 2017 21:09:55 +0100 Subject: [PATCH] For test emails, if there is no new content then just grab some old data. --- .../PlexRecentlyAddedNewsletter.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Ombi.Services/Jobs/RecentlyAddedNewsletter/PlexRecentlyAddedNewsletter.cs b/Ombi.Services/Jobs/RecentlyAddedNewsletter/PlexRecentlyAddedNewsletter.cs index 6ac7d76db..1f9601b07 100644 --- a/Ombi.Services/Jobs/RecentlyAddedNewsletter/PlexRecentlyAddedNewsletter.cs +++ b/Ombi.Services/Jobs/RecentlyAddedNewsletter/PlexRecentlyAddedNewsletter.cs @@ -121,6 +121,12 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter var filteredSeries = series.Where(x => recentlyAdded.All(c => c.ProviderId != x.ProviderId)).ToList(); var info = new List(); + + if (test && !filteredMovies.Any()) + { + // if this is a test make sure we show something + filteredMovies = movie.Take(5).ToList(); + } foreach (var m in filteredMovies) { var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, m.ItemId); @@ -178,6 +184,11 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter } else { + if (test && !filteredSeries.Any()) + { + // if this is a test make sure we show something + filteredSeries = series.Take(5).ToList(); + } foreach (var t in filteredSeries) { var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, t.ItemId);