Normal
Ok I found the issue. Is there any reason, that a program is needed to make a e.g. weekly recording?[code] /// <summary> /// Checks whether the recording should record the specified TVProgram /// at the specified time including the pre/post intervals /// </summary> /// <param name="dtTime">time</param> /// <param name="TVProgram">TVProgram</param> /// <param name="iPreInterval">pre record interval</param> /// <param name="iPostInterval">post record interval</param> /// <returns>true if the recording should record</returns> /// <seealso cref="MediaPortal.TV.Database.TVProgram"/> public bool IsRecordingProgramAtTime(DateTime dtTime,TVProgram currentProgram, int iPreInterval, int iPostInterval) { DateTime dtStart; DateTime dtEnd; switch (RecType) { // record program just once case RecordingType.Once: if (dtTime >= this.StartTime.AddMinutes(-iPreInterval) && dtTime <= this.EndTime.AddMinutes(iPostInterval) ) { if (Canceled>0) { return false; } if (currentProgram!=null) { if (currentProgram.Channel!=this.Channel) return false; if (dtTime >= currentProgram.StartTime.AddMinutes(-iPreInterval) && dtTime <= currentProgram.EndTime.AddMinutes(iPostInterval) ) { return true; } return false; } string strManual=GUILocalizeStrings.Get(413); if (this.Title.Length==0 || String.Compare(this.Title,strManual,true)==0) return true; strManual=GUILocalizeStrings.Get(736); if (this.Title.Length==0 || String.Compare(this.Title,strManual,true)==0) return true; return false; } break; // record program daily at same time & channel case RecordingType.WeekDays: if (currentProgram==null) return false; //we need a program if (currentProgram.Channel==this.Channel) //check channel is correct { // check if program start/date time is correct dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.StartTime.Hour,StartTime.Minute,0); dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.EndTime.Hour ,EndTime.Minute ,0); if (dtStart.DayOfWeek>=DayOfWeek.Monday && dtStart.DayOfWeek<=DayOfWeek.Friday) { if (dtTime >= dtStart.AddMinutes(-iPreInterval) && dtTime <= dtEnd.AddMinutes(iPostInterval) ) { // check if recording start/date time is correct dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.StartTime.Hour,StartTime.Minute,0); dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.EndTime.Hour ,EndTime.Minute ,0); if (dtTime >= dtStart.AddMinutes(-iPreInterval) && dtTime <= dtEnd.AddMinutes(iPostInterval) ) { // not canceled? if (IsSerieIsCanceled(currentProgram.StartTime)) { return false; } return true; } } } } break; // record program daily at same time & channel case RecordingType.Daily: if (currentProgram==null) return false; //we need a program if (currentProgram.Channel==this.Channel) //check channel is correct { // check if program start/date time is correct dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.StartTime.Hour,StartTime.Minute,0); dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.EndTime.Hour ,EndTime.Minute ,0); if (dtTime >= dtStart.AddMinutes(-iPreInterval) && dtTime <= dtEnd.AddMinutes(iPostInterval) ) { // check if recording start/date time is correct dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.StartTime.Hour,StartTime.Minute,0); dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.EndTime.Hour ,EndTime.Minute ,0); if (dtTime >= dtStart.AddMinutes(-iPreInterval) && dtTime <= dtEnd.AddMinutes(iPostInterval) ) { // not canceled? if (IsSerieIsCanceled(currentProgram.StartTime)) { return false; } return true; } } } break; // record program weekly at same time & channel case RecordingType.Weekly: if (currentProgram==null) return false; // we need a program if (currentProgram.Channel==this.Channel) // check if channel is correct { // check if day of week of program matches if (currentProgram.StartTime.DayOfWeek== dtTime.DayOfWeek) { // check if start/end time of program is correct dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.StartTime.Hour,currentProgram.StartTime.Minute,0); dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.EndTime.Hour ,currentProgram.EndTime.Minute ,0); if (dtTime >= dtStart.AddMinutes(-iPreInterval) && dtTime <= dtEnd.AddMinutes(iPostInterval) ) { // check if day of week of recording matches if (this.StartTime.DayOfWeek == dtTime.DayOfWeek) { // check if start/end time of recording is correct dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.StartTime.Hour,this.StartTime.Minute,0); dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.EndTime.Hour ,this.EndTime.Minute ,0); if (dtTime >= dtStart.AddMinutes(-iPreInterval) && dtTime <= dtEnd.AddMinutes(iPostInterval) ) { // not canceled? if (IsSerieIsCanceled(currentProgram.StartTime)) { return false; } return true; } } } } } break; //record program everywhere case RecordingType.EveryTimeOnEveryChannel: if (currentProgram==null) return false; // we need a program if (currentProgram.Title==this.Title) // check title { // check program time if (dtTime >= currentProgram.StartTime.AddMinutes(-iPreInterval) && dtTime <= currentProgram.EndTime.AddMinutes(iPostInterval) ) { // not canceled? if (IsSerieIsCanceled(currentProgram.StartTime)) { return false; } return true; } } break; //record program on this channel case RecordingType.EveryTimeOnThisChannel: if (currentProgram==null) return false; // we need a channel // check channel & title if (currentProgram.Title==this.Title && currentProgram.Channel==this.Channel) { // check time if (dtTime >= currentProgram.StartTime.AddMinutes(-iPreInterval) && dtTime <= currentProgram.EndTime.AddMinutes(iPostInterval) ) { // not canceled? if (IsSerieIsCanceled(currentProgram.StartTime)) { return false; } return true; } } break; } return false; }[/code]
Ok I found the issue. Is there any reason, that a program is needed to make a e.g. weekly recording?
[code] /// <summary>
/// Checks whether the recording should record the specified TVProgram
/// at the specified time including the pre/post intervals
/// </summary>
/// <param name="dtTime">time</param>
/// <param name="TVProgram">TVProgram</param>
/// <param name="iPreInterval">pre record interval</param>
/// <param name="iPostInterval">post record interval</param>
/// <returns>true if the recording should record</returns>
/// <seealso cref="MediaPortal.TV.Database.TVProgram"/>
public bool IsRecordingProgramAtTime(DateTime dtTime,TVProgram currentProgram, int iPreInterval, int iPostInterval)
{
DateTime dtStart;
DateTime dtEnd;
switch (RecType)
// record program just once
case RecordingType.Once:
if (dtTime >= this.StartTime.AddMinutes(-iPreInterval) && dtTime <= this.EndTime.AddMinutes(iPostInterval) )
if (Canceled>0)
return false;
}
if (currentProgram!=null)
if (currentProgram.Channel!=this.Channel) return false;
if (dtTime >= currentProgram.StartTime.AddMinutes(-iPreInterval) && dtTime <= currentProgram.EndTime.AddMinutes(iPostInterval) )
return true;
string strManual=GUILocalizeStrings.Get(413);
if (this.Title.Length==0 || String.Compare(this.Title,strManual,true)==0) return true;
strManual=GUILocalizeStrings.Get(736);
break;
// record program daily at same time & channel
case RecordingType.WeekDays:
if (currentProgram==null) return false; //we need a program
if (currentProgram.Channel==this.Channel) //check channel is correct
// check if program start/date time is correct
dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.StartTime.Hour,StartTime.Minute,0);
dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.EndTime.Hour ,EndTime.Minute ,0);
if (dtStart.DayOfWeek>=DayOfWeek.Monday && dtStart.DayOfWeek<=DayOfWeek.Friday)
if (dtTime >= dtStart.AddMinutes(-iPreInterval) && dtTime <= dtEnd.AddMinutes(iPostInterval) )
// check if recording start/date time is correct
dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.StartTime.Hour,StartTime.Minute,0);
dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.EndTime.Hour ,EndTime.Minute ,0);
// not canceled?
if (IsSerieIsCanceled(currentProgram.StartTime))
case RecordingType.Daily:
// record program weekly at same time & channel
case RecordingType.Weekly:
if (currentProgram==null) return false; // we need a program
if (currentProgram.Channel==this.Channel) // check if channel is correct
// check if day of week of program matches
if (currentProgram.StartTime.DayOfWeek== dtTime.DayOfWeek)
// check if start/end time of program is correct
dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.StartTime.Hour,currentProgram.StartTime.Minute,0);
dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,currentProgram.EndTime.Hour ,currentProgram.EndTime.Minute ,0);
// check if day of week of recording matches
if (this.StartTime.DayOfWeek == dtTime.DayOfWeek)
// check if start/end time of recording is correct
dtStart=new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.StartTime.Hour,this.StartTime.Minute,0);
dtEnd =new DateTime(dtTime.Year,dtTime.Month,dtTime.Day,this.EndTime.Hour ,this.EndTime.Minute ,0);
//record program everywhere
case RecordingType.EveryTimeOnEveryChannel:
if (currentProgram.Title==this.Title) // check title
// check program time
if (dtTime >= currentProgram.StartTime.AddMinutes(-iPreInterval) &&
dtTime <= currentProgram.EndTime.AddMinutes(iPostInterval) )
//record program on this channel
case RecordingType.EveryTimeOnThisChannel:
if (currentProgram==null) return false; // we need a channel
// check channel & title
if (currentProgram.Title==this.Title && currentProgram.Channel==this.Channel)
// check time
}[/code]