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

This commit is contained in:
tidusjar 2017-04-06 20:50:03 +01:00
commit e22dac963a
2 changed files with 8 additions and 3 deletions

View file

@ -116,7 +116,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
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();
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 info = new List<EmbyRecentlyAddedModel>();
@ -144,6 +144,11 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
// Check if there are any epiosdes, then get the series info.
// 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())
{
var recentlyAddedModel = new List<EmbyRecentlyAddedModel>();
@ -247,7 +252,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
{
RecentlyAddedLog.Insert(new RecentlyAddedLog
{
ProviderId = a.ProviderId,
ProviderId = a.EmbyId,
AddedAt = DateTime.UtcNow
});
}

View file

@ -33,7 +33,7 @@
<div class="form-group">
<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>
</div>