feat: Introduce ITranscriptionOrchestrator and related interfaces, refactoring DaemonService and other components to use dependency injection.
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user