mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Release Testing Final Stretch (#1952)
* Fixed a bug breaking ability to save server settings * Fixed a case where if a user updated appsetting.json, the DB wouldn't update to stay in alignment.
This commit is contained in:
parent
2d842f3783
commit
b7c9762956
@ -32,6 +32,7 @@ using Microsoft.AspNetCore.Identity;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.ResponseCompression;
|
using Microsoft.AspNetCore.ResponseCompression;
|
||||||
using Microsoft.AspNetCore.StaticFiles;
|
using Microsoft.AspNetCore.StaticFiles;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
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
|
// We don't update the index.html in local as we don't serve from there
|
||||||
UpdateBaseUrlInIndex(basePath);
|
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();
|
app.UseRouting();
|
||||||
|
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
"TokenKey": "super secret unguessable key",
|
"TokenKey": "super secret unguessable key",
|
||||||
"Port": 5000,
|
"Port": 5000,
|
||||||
"IpAddresses": "",
|
"IpAddresses": "",
|
||||||
"BaseUrl": "/"
|
"BaseUrl": "/joe/"
|
||||||
}
|
}
|
@ -83,7 +83,7 @@ export class ManageSettingsComponent implements OnInit {
|
|||||||
|
|
||||||
async saveSettings() {
|
async saveSettings() {
|
||||||
const modelSettings = this.settingsForm.value;
|
const modelSettings = this.settingsForm.value;
|
||||||
|
modelSettings.bookmarksDirectory = this.serverSettings.bookmarksDirectory;
|
||||||
this.settingsService.updateServerSettings(modelSettings).pipe(take(1)).subscribe((settings: ServerSettings) => {
|
this.settingsService.updateServerSettings(modelSettings).pipe(take(1)).subscribe((settings: ServerSettings) => {
|
||||||
this.serverSettings = settings;
|
this.serverSettings = settings;
|
||||||
this.resetForm();
|
this.resetForm();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user