Webuntis stunden check
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
2026-09-08 23:59:07 +02:00
parent e86125e5f9
commit 2ec8adac61
7 changed files with 348 additions and 1 deletions
@@ -205,6 +205,13 @@ public sealed class WebUntisIntegrationService(HttpClient http, WebUntisSettings
};
}
public Task<UntisOpenPeriodsMeta> GetOpenPeriodsMetaAsync(int schoolYearId, CancellationToken token = default) =>
ExecuteAsync(client => client.GetOpenPeriodsMetaAsync(schoolYearId, token), token);
public Task<IReadOnlyList<UntisOpenPeriod>> GetOpenPeriodsAsync(int schoolYearId, int? teacherId,
int? classId, DateOnly start, DateOnly end, CancellationToken token = default) =>
ExecuteAsync(client => client.GetOpenPeriodsAsync(schoolYearId, teacherId, classId, start, end, token), token);
private async Task<T> ExecuteAsync<T>(Func<WebUntisClient, Task<T>> operation, CancellationToken token)
{
try { return await operation(await GetClientAsync(token)); }