Web: Save config to file when changed

This commit is contained in:
genteure 2022-07-08 21:13:00 +08:00
parent 35fe543b70
commit f26067cd5d
2 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,7 @@ namespace BililiveRecorder.Web.Api
public ActionResult<GlobalConfigDto> SetGlobalConfig([FromBody] SetGlobalConfig config)
{
config.ApplyTo(this.recorder.Config.Global);
this.recorder.SaveConfig();
return this.mapper.Map<GlobalConfigDto>(this.recorder.Config.Global);
}
}

View File

@ -260,6 +260,8 @@ namespace BililiveRecorder.Web.Api
config.ApplyTo(room.RoomConfig);
this.recorder.SaveConfig();
return this.mapper.Map<RoomConfigDto>(room.RoomConfig);
}
@ -280,6 +282,8 @@ namespace BililiveRecorder.Web.Api
config.ApplyTo(room.RoomConfig);
this.recorder.SaveConfig();
return this.mapper.Map<RoomConfigDto>(room.RoomConfig);
}