Also fixed the issue for the Emby Newsletter where episodes were not getting added :(

pull/1349/head
tidusjar 8 years ago
parent d53864fef1
commit e22dac963a

@ -116,7 +116,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
var firstRun = !recentlyAdded.Any(); var firstRun = !recentlyAdded.Any();
var filteredMovies = movie.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList(); 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(); var filteredEp = episodes.Where(m => recentlyAdded.All(x => x.ProviderId != m.EmbyId)).ToList();
var filteredSeries = series.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList(); var filteredSeries = series.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList();
var info = new List<EmbyRecentlyAddedModel>(); var info = new List<EmbyRecentlyAddedModel>();
@ -144,6 +144,11 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
// Check if there are any epiosdes, then get the series info. // Check if there are any epiosdes, then get the series info.
// Otherwise then just add the series to the newsletter // Otherwise then just add the series to the newsletter
if (test && !filteredEp.Any() && episodes.Any())
{
// if this is a test make sure we show something
filteredEp = episodes.Take(5).ToList();
}
if (filteredEp.Any()) if (filteredEp.Any())
{ {
var recentlyAddedModel = new List<EmbyRecentlyAddedModel>(); var recentlyAddedModel = new List<EmbyRecentlyAddedModel>();
@ -247,7 +252,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
{ {
RecentlyAddedLog.Insert(new RecentlyAddedLog RecentlyAddedLog.Insert(new RecentlyAddedLog
{ {
ProviderId = a.ProviderId, ProviderId = a.EmbyId,
AddedAt = DateTime.UtcNow AddedAt = DateTime.UtcNow
}); });
} }

@ -33,7 +33,7 @@
<div class="form-group"> <div class="form-group">
<div> <div>
<button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin @Html.ToolTip("Note: If there is nothing new when testing this, we will just grab some random titles") <button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin @Html.ToolTip("Note: If there is nothing new when testing this, we will just grab some random titles. If there are new items, then we will show those new items. Testing will not mark the content as 'Previously Sent'")
<div id="testEmailSpinner"></div></button> <div id="testEmailSpinner"></div></button>
</div> </div>
</div> </div>

Loading…
Cancel
Save