Exemplo n.º 1
0
    public static bool IsPartialRecording(Schedule schedule, Program prg)
    {
      if (schedule.ScheduleType == (int)ScheduleRecordingType.EveryTimeOnEveryChannel ||
          schedule.ScheduleType == (int)ScheduleRecordingType.EveryTimeOnThisChannel ||
          schedule.ScheduleType == (int)ScheduleRecordingType.WeeklyEveryTimeOnThisChannel)
      {
        return false;
      }

      DateTime schStart;
      DateTime schEnd;

      if (schedule.GetAdjustedScheduleTimeRange(prg, out schStart, out schEnd))
      {
        return (prg.StartTime < schStart || prg.EndTime > schEnd);
      }
      else
      {
        Log.Info(
          "IsPartialRecording: program ({0} {1} - {2} is not (at least partially) included in the schedule {3:hh:mm} - {4:hh:mm}",
          prg.Title, prg.StartTime, prg.EndTime, schedule.startTime, schedule.endTime);
        return false;
      }
    }