From c978d66c56945a5c7b4a710fe8e9cfea24737a83 Mon Sep 17 00:00:00 2001 From: administrator Date: Mon, 11 May 2026 15:08:28 +0200 Subject: [PATCH] EPG-Refresh: periodischer Timer alle 60s aktualisiert Jetzt/Danach wenn Sendung endet --- MainWindow.xaml.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 03fa53b..6ec1445 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -34,6 +34,9 @@ public partial class MainWindow : Window // EPG-Fallback Timer (falls MetaChanged nicht feuert) private readonly DispatcherTimer _epgTimer; + // Periodischer Refresh: aktualisiert Jetzt/Danach wenn Sendung endet + private readonly DispatcherTimer _epgRefreshTimer; + // Pre-Fullscreen UI-State private WindowStyle _prevStyle = WindowStyle.SingleBorderWindow; private WindowState _prevState = WindowState.Normal; @@ -56,6 +59,11 @@ public partial class MainWindow : Window _epgTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) }; _epgTimer.Tick += EpgTimer_Tick; + // Jede Minute prüfen ob Jetzt/Danach noch aktuell sind + _epgRefreshTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(60) }; + _epgRefreshTimer.Tick += (_, _) => { if (_currentChannel != null) UpdateNextFromEpgService(_currentChannel); }; + _epgRefreshTimer.Start(); + Loaded += MainWindow_Loaded; Closing += MainWindow_Closing; KeyDown += MainWindow_KeyDown; @@ -130,6 +138,7 @@ public partial class MainWindow : Window { _epgTimer.Stop(); _zapTimer.Stop(); + _epgRefreshTimer.Stop(); _player?.Stop(); _settings.LastChannel = _currentChannel?.Name ?? ""; _settings.Volume = SldVolume.Value;