EPG-Refresh: periodischer Timer alle 60s aktualisiert Jetzt/Danach wenn Sendung endet

This commit is contained in:
administrator 2026-05-11 15:08:28 +02:00
parent 735ab0b489
commit c978d66c56

View file

@ -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;