1
0

feat: Introduce ITranscriptionOrchestrator and related interfaces, refactoring DaemonService and other components to use dependency injection.

This commit is contained in:
2026-02-28 15:36:03 +01:00
parent ac0ac2397b
commit 0577640da9
18 changed files with 356 additions and 175 deletions

View File

@@ -1,21 +1,23 @@
using Toak.Core.Interfaces;
namespace Toak.Core;
public static class StateTracker
public class StateTracker : IRecordingStateTracker
{
private static readonly string StateFilePath = Path.Combine(Path.GetTempPath(), "toak_state.pid");
private readonly string StateFilePath = Path.Combine(Path.GetTempPath(), "toak_state.pid");
public static bool IsRecording()
public bool IsRecording()
{
return File.Exists(StateFilePath);
}
public static void SetRecording(int ffmpegPid)
public void SetRecording(int ffmpegPid)
{
Logger.LogDebug($"Setting recording state with PID {ffmpegPid}");
File.WriteAllText(StateFilePath, ffmpegPid.ToString());
}
public static int? GetRecordingPid()
public int? GetRecordingPid()
{
if (File.Exists(StateFilePath))
{
@@ -29,7 +31,7 @@ public static class StateTracker
return null;
}
public static void ClearRecording()
public void ClearRecording()
{
if (File.Exists(StateFilePath))
{