feat(macos): enable meeting integrations

This commit is contained in:
dh
2026-08-06 08:19:26 +02:00
parent 9542c05ea4
commit 2af7933a1b
27 changed files with 1999 additions and 227 deletions
@@ -0,0 +1,58 @@
using System.Diagnostics;
namespace MeetingAssistant.MeetingNotes;
internal static class MeetingMetadataDiagnosticRunner
{
public static async Task<MeetingMetadataDiagnosticResult> RunAsync(
string provider,
DateTimeOffset startedAt,
TimeSpan timeout,
Func<CancellationToken, Task<MeetingMetadata?>> lookupAsync,
string noMatchError,
CancellationToken cancellationToken)
{
var stopwatch = Stopwatch.StartNew();
try
{
var lookup = lookupAsync(cancellationToken);
var metadata = timeout > TimeSpan.Zero
? await lookup.WaitAsync(timeout, cancellationToken)
: await lookup.WaitAsync(cancellationToken);
return new MeetingMetadataDiagnosticResult(
provider,
startedAt,
metadata is not null,
false,
stopwatch.ElapsedMilliseconds,
metadata,
metadata is null ? noMatchError : null);
}
catch (TimeoutException exception)
{
return new MeetingMetadataDiagnosticResult(
provider,
startedAt,
false,
true,
stopwatch.ElapsedMilliseconds,
null,
exception.Message);
}
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
{
throw;
}
catch (Exception exception)
{
return new MeetingMetadataDiagnosticResult(
provider,
startedAt,
false,
false,
stopwatch.ElapsedMilliseconds,
null,
exception.Message);
}
}
}