WIP (unstable): WebUntis-iCal-Abgleich für Vertretungen/Ausfälle
Erkennt Vertretungen, Ausfälle und Zusatzaufsichten aus dem persönlichen WebUntis-iCal-Feed und schreibt sie automatisch als SubstitutionEntry. Bekannter offener Bug: es tauchen weiterhin falsche Vertretungen für Stunden auf, die real unverändert sind — wird in einem Folge-Commit untersucht, deshalb vorerst auf diesem Branch statt main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -742,6 +742,8 @@ public class SubstitutionEntryRepository(LiteDbContext db) : ISubstitutionEntryR
|
||||
public List<SubstitutionEntry> GetAll() => db.SubstitutionEntries.FindAll().OrderBy(e => e.Date).ToList();
|
||||
public List<SubstitutionEntry> GetByDate(DateOnly date) =>
|
||||
db.SubstitutionEntries.Find(e => e.Date == date).ToList();
|
||||
public SubstitutionEntry? GetByExternalId(string externalId) =>
|
||||
db.SubstitutionEntries.FindOne(e => e.ExternalId == externalId);
|
||||
public void Save(SubstitutionEntry entry)
|
||||
{
|
||||
db.SubstitutionEntries.Upsert(entry);
|
||||
@@ -754,6 +756,26 @@ public class SubstitutionEntryRepository(LiteDbContext db) : ISubstitutionEntryR
|
||||
}
|
||||
}
|
||||
|
||||
// Bewusst kein db.OnChange hier (anders als sonst überall): UntisSnapshotEntry ist eine rein
|
||||
// lokale, hochfrequente Abgleich-Zwischenablage (jeder Poll aktualisiert alle Zeilen), deren
|
||||
// Sync nur Rauschen erzeugen würde. UntisSlotMapping ist an die pro Gerät hinterlegte
|
||||
// WebUntis-URL gebunden (WebUntisSettingsService, wie SyncSettingsService nicht synchronisiert)
|
||||
// und deshalb ebenfalls sinnvollerweise lokal — jedes Gerät bestätigt seine Zuordnung einmal
|
||||
// selbst über den Review-Dialog.
|
||||
public class UntisSnapshotRepository(LiteDbContext db) : IUntisSnapshotRepository
|
||||
{
|
||||
public List<UntisSnapshotEntry> GetAll() => db.UntisSnapshotEntries.FindAll().ToList();
|
||||
public void Save(UntisSnapshotEntry entry) => db.UntisSnapshotEntries.Upsert(entry);
|
||||
public void Delete(Guid id) => db.UntisSnapshotEntries.Delete(id);
|
||||
}
|
||||
|
||||
public class UntisSlotMappingRepository(LiteDbContext db) : IUntisSlotMappingRepository
|
||||
{
|
||||
public List<UntisSlotMapping> GetAll() => db.UntisSlotMappings.FindAll().ToList();
|
||||
public void Save(UntisSlotMapping mapping) => db.UntisSlotMappings.Upsert(mapping);
|
||||
public void Delete(Guid id) => db.UntisSlotMappings.Delete(id);
|
||||
}
|
||||
|
||||
public class CompetencyDomainRepository(LiteDbContext db) : ICompetencyDomainRepository
|
||||
{
|
||||
public List<CompetencyDomain> GetBySubjectAndGrade(Guid subjectId, int gradeLevel) =>
|
||||
|
||||
Reference in New Issue
Block a user