Fixed a little bug in the newsletter

pull/2142/head
Jamie 7 years ago
parent 9bd545c736
commit 848ddbdbf0

@ -259,19 +259,11 @@ namespace Ombi.Schedule.Jobs.Ombi
var ordered = plexContentToSend.OrderByDescending(x => x.AddedAt);
foreach (var content in ordered)
{
if (content.TheMovieDbId.IsNullOrEmpty())
{
// Maybe we should try the ImdbId?
if (content.ImdbId.HasValue())
int.TryParse(content.TheMovieDbId, out var movieDbId);
if (movieDbId <= 0)
{
var findResult = await _movieApi.Find(content.ImdbId, ExternalSource.imdb_id);
var movieId = findResult.movie_results?[0]?.id ?? 0;
content.TheMovieDbId = movieId.ToString();
}
continue;
}
int.TryParse(content.TheMovieDbId, out var movieDbId);
var info = await _movieApi.GetMovieInformationWithExtraInfo(movieDbId);
if (info == null)
{

@ -67,11 +67,27 @@ namespace Ombi
}
}
DeleteSchedulesDb();
Console.WriteLine($"We are running on {urlValue}");
BuildWebHost(args).Run();
}
private static void DeleteSchedulesDb()
{
try
{
if (File.Exists("Schedules.db"))
{
File.Delete("Schedules.db");
}
}
catch (Exception)
{
}
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()

@ -68,7 +68,6 @@ O:::::::OOO:::::::Om::::m m::::m m::::mb:::::bbbbbb::::::bi::::::i
<link rel="apple-touch-icon" sizes="180x180" href="~/images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="~/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="~/images/favicon/favicon-16x16.png">
<link rel="manifest" href="~/images/favicon/site.webmanifest">
<link rel="mask-icon" href="~/images/favicon/safari-pinned-tab.svg" color="#df691a">
<link rel="shortcut icon" href="~/images/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#df691a">

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save