Import old photos on startup.

This commit is contained in:
2019-06-01 12:36:57 +01:00
parent c43f88a936
commit 009b4d2e92
5 changed files with 249 additions and 104 deletions

View File

@@ -164,6 +164,22 @@ namespace cicm_web
context.SaveChanges();
end = DateTime.Now;
Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m",
(end - start).TotalSeconds);
start = DateTime.Now;
Console.WriteLine("\u001b[31;1mImporting photos...\u001b[0m");
try { Photos.ImportPhotos(context); }
catch(Exception e)
{
Console.WriteLine("Exception {0} importing photos, saving changes and continuing...", e);
throw;
}
context.SaveChanges();
end = DateTime.Now;
Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m",
(end - start).TotalSeconds);