Fixed the migration number and order by the added date for the newsletter #1264

pull/1351/head
tidusjar 8 years ago
parent 205f72a83d
commit f051bebd3e

@ -53,7 +53,7 @@ namespace Ombi.Core.Migration.Migrations
EmbyEpisodes = embyEp;
}
public int Version => 22000;
public int Version => 22100;
private IRepository<RecentlyAddedLog> Log { get; }
private IRepository<PlexContent> PlexContent { get; }
private IRepository<PlexEpisodes> PlexEpisodes { get; }

@ -276,7 +276,8 @@ namespace Ombi.Services.Jobs
Title = m.Title,
Type = Store.Models.Plex.PlexMediaType.Movie,
Url = m.Url,
ItemId = m.ItemId
ItemId = m.ItemId,
AddedAt = DateTime.UtcNow,
});
}
}
@ -318,7 +319,8 @@ namespace Ombi.Services.Jobs
Type = Store.Models.Plex.PlexMediaType.Show,
Url = t.Url,
Seasons = ByteConverterHelper.ReturnBytes(t.Seasons),
ItemId = t.ItemId
ItemId = t.ItemId,
AddedAt = DateTime.UtcNow,
});
}
}
@ -360,7 +362,8 @@ namespace Ombi.Services.Jobs
Title = a.Title,
Type = Store.Models.Plex.PlexMediaType.Artist,
Url = a.Url,
ItemId = "album"
ItemId = "album",
AddedAt = DateTime.UtcNow,
});
}
}

@ -120,7 +120,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
var filteredSeries = series.Where(m => recentlyAdded.All(x => x.ProviderId != m.EmbyId)).ToList();
var info = new List<EmbyRecentlyAddedModel>();
foreach (var m in filteredMovies)
foreach (var m in filteredMovies.OrderByDescending(x => x.AddedAt))
{
var policy = RetryHandler.RetryAndWaitPolicy((exception, timespan) =>
Log.Error(exception, "Exception thrown when processing an emby movie for the newsletter, Retrying {0}", timespan));
@ -210,7 +210,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
}
else
{
foreach (var t in filteredSeries)
foreach (var t in filteredSeries.OrderByDescending(x => x.AddedAt))
{

@ -127,7 +127,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
// 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.OrderByDescending(x => x.AddedAt))
{
var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, m.ItemId);
if (i.Video == null)
@ -194,7 +194,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
// 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.OrderByDescending(x => x.AddedAt))
{
var i = Api.GetMetadata(plexSettings.PlexAuthToken, plexSettings.FullUri, t.ItemId);
if (i.Directory == null)

Loading…
Cancel
Save