From 03d5cd3a40e2fe4292d1f2ba34a88aedd919d169 Mon Sep 17 00:00:00 2001 From: Kieran Coldron Date: Sun, 12 Nov 2023 21:23:29 +0000 Subject: [PATCH] remove some logging and fix config in main --- backend/src/obs_recorder/ObsRecordingService.cs | 3 --- backend/src/obs_recorder/Program.cs | 7 +++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/backend/src/obs_recorder/ObsRecordingService.cs b/backend/src/obs_recorder/ObsRecordingService.cs index 17f48c7..18b7183 100644 --- a/backend/src/obs_recorder/ObsRecordingService.cs +++ b/backend/src/obs_recorder/ObsRecordingService.cs @@ -403,8 +403,6 @@ void OnAudioData(IntPtr param, IntPtr source, ref AudioData audioData, bool mute percentage = Math.Min(Math.Max(percentage, 0.0f), 100.0f); - Logger.LogError("Volume: " + percentage); - string sourceName = null; if (source == IntPtr.Zero) { @@ -415,7 +413,6 @@ void OnAudioData(IntPtr param, IntPtr source, ref AudioData audioData, bool mute sourceName = GetSourceName(source); } - Logger.LogError("Source: " + sourceName); OnVolumePeakChanged?.Invoke(new VolumePeakLevel() { Peak = percentage, Source = sourceName }); } diff --git a/backend/src/obs_recorder/Program.cs b/backend/src/obs_recorder/Program.cs index a4b7bcf..fe026b3 100644 --- a/backend/src/obs_recorder/Program.cs +++ b/backend/src/obs_recorder/Program.cs @@ -43,7 +43,7 @@ app.MapGet("/api/StopStreaming", (ObsRecordingService recorder) => recorder.StopStreaming()); app.MapGet("/api/GetStatus", (ObsRecordingService recorder) => recorder.GetStatus()); -app.MapGet("/api/GetConfig", (ConfigService config) => config.GetConfig()); +app.MapGet("/api/GetConfig", (ConfigService configService) => configService.Config); app.MapPost("/api/SaveConfig", (ConfigService config, ConfigModel newConfig) => config.SaveConfig(newConfig)); app.MapGet("/api/UpdateBufferSettings", (ObsRecordingService recorder) => recorder.UpdateBufferSettings()); app.MapGet("/api/SaveReplayBuffer", (ObsRecordingService recorder) => recorder.SaveReplayBuffer()); @@ -52,10 +52,9 @@ { try { - var config = configService.GetConfig(); - - if (config.ReplayBufferEnabled == enabled) return true; + if (configService.Config.ReplayBufferEnabled == enabled) return true; + var config = configService.Config; config.ReplayBufferEnabled = enabled; await configService.SaveConfig(config);