private static string GetRecordingDateTime(TVProgramDescription rec) { return(String.Format("{0} {1} - {2}", MediaPortal.Util.Utils.GetShortDayString(rec.StartTime), rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat), rec.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat))); }
private void ProcessNotifies(DateTime preNotifySecs) { if (_notifiesListChanged) { LoadNotifies(); _notifiesListChanged = false; } if (_notifiesList != null && _notifiesList.Count > 0) { foreach (Program program in _notifiesList) { if (System.DateTime.Now > program.EndTime) { Log.Debug("Notify auto cancel old program {0} on {1} ended {2}", program.Title, program.ReferencedChannel().DisplayName, program.EndTime); program.Notify = false; program.Persist(); _notifiesList.Remove(program); return; } if (preNotifySecs > program.StartTime) { Log.Info("Notify {0} on {1} start {2}", program.Title, program.ReferencedChannel().DisplayName, program.StartTime); program.Notify = false; program.Persist(); TVProgramDescription tvProg = new TVProgramDescription(); tvProg.Channel = program.ReferencedChannel(); tvProg.Title = program.Title; tvProg.Description = program.Description; tvProg.Genre = program.Genre; tvProg.StartTime = program.StartTime; tvProg.EndTime = program.EndTime; _notifiesList.Remove(program); Log.Info("send notify"); GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY_TV_PROGRAM, 0, 0, 0, 0, 0, null); msg.Object = tvProg; GUIGraphicsContext.SendMessage(msg); msg = null; Log.Info("send notify done"); return; } } } }
private void ProcessNotifies(DateTime preNotifySecs) { if (_notifiesListChanged) { LoadNotifies(); _notifiesListChanged = false; } if (_notifiesList != null && _notifiesList.Count > 0) { foreach (Program program in _notifiesList) { if (preNotifySecs > program.StartTime) { Log.Info("Notify {0} on {1} start {2}", program.Title, program.ReferencedChannel().DisplayName, program.StartTime); program.Notify = false; program.Persist(); TVProgramDescription tvProg = new TVProgramDescription(); tvProg.Channel = program.ReferencedChannel(); tvProg.Title = program.Title; tvProg.Description = program.Description; tvProg.Genre = program.Genre; tvProg.StartTime = program.StartTime; tvProg.EndTime = program.EndTime; _notifiesList.Remove(program); Log.Info("send notify"); GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY_TV_PROGRAM, 0, 0, 0, 0, 0, null); msg.Object = tvProg; GUIGraphicsContext.SendMessage(msg); msg = null; Log.Info("send notify done"); return; } } } }
private static string GetRecordingDateTime(TVProgramDescription rec) { return String.Format("{0} {1} - {2}", MediaPortal.Util.Utils.GetShortDayString(rec.StartTime), rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat), rec.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat)); }