mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Do not seed ISO-639 codes, but read them from a file on startup.
This commit is contained in:
@@ -39,6 +39,7 @@ using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Iso639 = cicm_web.Helpers.Iso639;
|
||||
using Version = DiscImageChef.Interop.Version;
|
||||
|
||||
namespace cicm_web
|
||||
@@ -180,6 +181,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 ISO-639 codes...\u001b[0m");
|
||||
|
||||
try { Iso639.Import(context); }
|
||||
catch(Exception e)
|
||||
{
|
||||
Console.WriteLine("Exception {0} importing ISO-639 codes, 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);
|
||||
|
||||
Reference in New Issue
Block a user