Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Merge branch 'main' into develop

Joseph Milazzo9dfb1a3d27c1
diff --cc API/Data/Seed.cs
index 7185b403d,d376fc3fb..838277931
--- a/API/Data/Seed.cs
+++ b/API/Data/Seed.cs
@@@ -61,13 -62,30 +62,29 @@@ namespace API.Dat
await context.SaveChangesAsync();
// Port and LoggingLevel are managed in appSettings.json. Update the DB values to match
- var configFile = Program.GetAppSettingFilename();
context.ServerSetting.FirstOrDefault(s => s.Key == ServerSettingKey.Port).Value =
- Configuration.GetPort(configFile) + "";
+ Configuration.Port + string.Empty;
context.ServerSetting.FirstOrDefault(s => s.Key == ServerSettingKey.LoggingLevel).Value =
- Configuration.GetLogLevel(configFile);
-
+ Configuration.LogLevel + string.Empty;
+
await context.SaveChangesAsync();
-
+
}
+
+ public static async Task SeedSeriesMetadata(DataContext context)
+ {
+ await context.Database.EnsureCreatedAsync();
+
+ context.Database.EnsureCreated();
+ var series = await context.Series
+ .Include(s => s.Metadata).ToListAsync();
+
+ foreach (var s in series)
+ {
+ s.Metadata ??= new SeriesMetadata();
+ }
+
+ await context.SaveChangesAsync();
+ }
}
-}
+}