First run of the newsletter set it to a test

pull/1061/head
tidusjar 8 years ago
parent 8393a31a48
commit 74066d0351

@ -106,7 +106,9 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
var episodes = Episodes.GetAll().ToList();
var movie = embyContent.Where(x => x.Type == EmbyMediaType.Movie).ToList();
var recentlyAdded = RecentlyAddedLog.GetAll();
var recentlyAdded = RecentlyAddedLog.GetAll().ToList();
var firstRun = !recentlyAdded.Any();
var filteredMovies = movie.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList();
var filteredEp = episodes.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList();
@ -156,7 +158,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
var html = template.LoadTemplate(sb.ToString());
Log.Debug("Loaded the template");
if (!test)
if (!test || firstRun)
{
foreach (var a in filteredMovies)
{

Loading…
Cancel
Save