For test emails, if there is no new content then just grab some old data.

pull/1334/head
tidusjar 8 years ago
parent ceb942bba7
commit 8a55de2b71

@ -121,6 +121,12 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
var filteredSeries = series.Where(x => recentlyAdded.All(c => c.ProviderId != x.ProviderId)).ToList(); var filteredSeries = series.Where(x => recentlyAdded.All(c => c.ProviderId != x.ProviderId)).ToList();
var info = new List<PlexRecentlyAddedModel>(); var info = new List<PlexRecentlyAddedModel>();
if (test && !filteredMovies.Any())
{
// if this is a test make sure we show something
filteredMovies = movie.Take(5).ToList();
}
foreach (var m in filteredMovies) foreach (var m in filteredMovies)
{ {
var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, m.ItemId); var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, m.ItemId);
@ -178,6 +184,11 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
} }
else 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) foreach (var t in filteredSeries)
{ {
var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, t.ItemId); var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, t.ItemId);

Loading…
Cancel
Save