Fixed a bug in the Plex Newsletter

pull/1215/head
tidusjar 8 years ago
parent c3cba15b17
commit c95e7368ae

@ -117,12 +117,16 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
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 filteredSeries = series.Where(x => recentlyAdded.All(c => c.ProviderId != x.ProviderId)).ToList();
var info = new List<PlexRecentlyAddedModel>();
foreach (var m in filteredMovies)
{
var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, m.ItemId);
if (i.Video == null)
{
continue;
}
info.Add(new PlexRecentlyAddedModel
{
Metadata = i,
@ -132,10 +136,14 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
GenerateMovieHtml(info, sb);
info.Clear();
foreach (var t in series)
foreach (var t in filteredSeries)
{
var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, t.ItemId);
if (i.Directory == null)
{
continue;
}
//var ep = filteredEp.Where(x => x.ShowTitle == t.Title);
info.Add(new PlexRecentlyAddedModel
{
@ -183,6 +191,14 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
AddedAt = DateTime.UtcNow
});
}
foreach (var a in filteredSeries)
{
RecentlyAddedLog.Insert(new RecentlyAddedLog
{
ProviderId = a.ProviderId,
AddedAt = DateTime.UtcNow
});
}
}
var escapedHtml = new string(html.Where(c => !char.IsControl(c)).ToArray());

@ -25,6 +25,7 @@
// ***********************************************************************
#endregion
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
@ -61,7 +62,7 @@ namespace Ombi.Store
{
connection.Open();
var result = connection.Query<TableInfo>($"PRAGMA table_info({tableName});");
if (result.Any(x => x.name == newColumn))
if (result.Any(x => x.name.Equals(newColumn, StringComparison.CurrentCultureIgnoreCase)))
{
connection.Close();
return;

Loading…
Cancel
Save