private void Check() { if (OnNewNotification == null) { return; } PlexListenerEventData eventData = null; try { eventData = CreateEventDataFromMediaContainer(_plexWebChecker.Check()); } catch (Exception ex) { eventData = new PlexListenerEventData { EventType = EventType.Error, ErrorMessage = ex.Message }; } finally { if (_lastEventData == null || (eventData != null && _lastEventData.EventType != eventData.EventType)) { _lastEventData = eventData; Notify(eventData); } } }
public PlexListenerEventData GetStatus() { PlexListenerEventData eventData = null; try { eventData = CreateEventDataFromMediaContainer(_plexWebChecker.Check()); } catch (Exception ex) { eventData = new PlexListenerEventData { EventType = EventType.Error, ErrorMessage = ex.Message }; } return(eventData); }