public static string MatchedChannelCallsign(this CommonEPG.TVProgramme tvp) { CommonEPG.TVService tvc = EPGManager.TVServiceWithIDOrNull(tvp.ServiceID); if (tvc == null) { return("Unknown"); } return(tvc.Callsign); }
public static int DurationMinutes(this CommonEPG.TVProgramme tvp) { try { long lDuration = tvp.StopTime - tvp.StartTime; TimeSpan tDuration = new TimeSpan(lDuration); return(Convert.ToInt32(tDuration.TotalMinutes)); } catch { if (Settings.Default.DebugAdvanced) { Functions.WriteLineToLogFile("Error [extension method error DurationMinutes] - could not get duration for show " + tvp.Title + " starts:" + tvp.StartTime.ToString() + " stops:" + tvp.StopTime.ToString()); } } return(0); }
public static bool IsTopRated(this CommonEPG.TVProgramme tvp) { return(tvp.StarRating > 7); }
public static bool IsRecommended(this CommonEPG.TVProgramme tvp) { return(tvp.StarRating > 6); }
public static bool HasEndedYet(this CommonEPG.TVProgramme tvp) { return(tvp.StopTimeDT().ToLocalTime() <= DateTime.Now); }
public static string ToPrettyDate(this CommonEPG.TVProgramme tvp) { return(tvp.StartTimeDT().ToPrettyDate()); }
public static string ToPrettyStartStopLocalTimes(this CommonEPG.TVProgramme tvp) { return(tvp.StartTimeDT().ToLocalTime().ToShortTimeString() + " - " + tvp.StopTimeDT().ToLocalTime().ToShortTimeString()); }
public static DateTime OriginalAirDateDT(this CommonEPG.TVProgramme tvp) { return(new DateTime(tvp.OriginalAirDate, DateTimeKind.Utc)); }
public static DateTime StopTimeDT(this CommonEPG.TVProgramme tvp) { return(new DateTime(tvp.StopTime, DateTimeKind.Utc)); }