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.

Release Testing Final Stretch (#1952)

Joe Milazzob7c976295661
diff --git a/API/Startup.cs b/API/Startup.cs
index e916e1c50..8e8a2e1ce 100644
--- a/API/Startup.cs
+++ b/API/Startup.cs
@@ -32,6 +32,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.StaticFiles;
+using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@@ -294,8 +295,17 @@ public class Startup
{
// We don't update the index.html in local as we don't serve from there
UpdateBaseUrlInIndex(basePath);
- }
+ // Update DB with what's in config
+ var dataContext = serviceProvider.GetRequiredService<DataContext>();
+ var setting = dataContext.ServerSetting.SingleOrDefault(x => x.Key == ServerSettingKey.BaseUrl);
+ if (setting != null)
+ {
+ setting.Value = basePath;
+ }
+
+ dataContext.SaveChanges();
+ }
app.UseRouting();
diff --git a/API/config/appsettings.Development.json b/API/config/appsettings.Development.json
index 2a9bbdd2c..a1767e9d8 100644
--- a/API/config/appsettings.Development.json
+++ b/API/config/appsettings.Development.json
@@ -2,5 +2,5 @@
"TokenKey": "super secret unguessable key",
"Port": 5000,
"IpAddresses": "",
- "BaseUrl": "/"
+ "BaseUrl": "/joe/"
}
\ No newline at end of file
diff --git a/UI/Web/src/app/admin/manage-settings/manage-settings.component.ts b/UI/Web/src/app/admin/manage-settings/manage-settings.component.ts
index 682a9ddce..1122fd34a 100644
--- a/UI/Web/src/app/admin/manage-settings/manage-settings.component.ts
+++ b/UI/Web/src/app/admin/manage-settings/manage-settings.component.ts
@@ -83,7 +83,7 @@ export class ManageSettingsComponent implements OnInit {
async saveSettings() {
const modelSettings = this.settingsForm.value;
-
+ modelSettings.bookmarksDirectory = this.serverSettings.bookmarksDirectory;
this.settingsService.updateServerSettings(modelSettings).pipe(take(1)).subscribe((settings: ServerSettings) => {
this.serverSettings = settings;
this.resetForm();