TVService - Not detecting if episode has been recorded (1 Viewer)

sunedane

Portal Member
November 30, 2008
16
5
Home Country
Denmark Denmark
Hi.

Just updated to 1.2.3

TVService is not detecting if episode is recorded or not since this commit to git :
Mantis 3608 - Duplicate episode detection does not work within the same day

The check to see if the recording is present or not is now broken. If a recording is present THIS code should return true, if not, it will be detected as a previous failure.

new code:
Code:
if (pastRecordings[i].StartTime <= newRecording.Program.EndTime.AddMinutes(newRecording.Schedule.PostRecordInterval) &&
                      pastRecordings[i].EndTime >= newRecording.Program.StartTime.AddMinutes(-newRecording.Schedule.PreRecordInterval))

If episode 1 is recorded Monday at 10:00 to 11:00 and the the same episode is due for recording Tuesday at 08:00 to 09:00 the last check will never return true. past recording end time will never be greater than the new recordings start time.
if the code returns false it will be detected as a faulty recording and will re-record it.

I can't see how this code should fix duplicate episode detection for recording the same day either.
The code is only triggered if the episode is already present.
The check should return false ONLY if the past recording is exactly the same recording as the new recording.

Further more the check does not handle if you have chosen to record every time on every channel, and the same episode is broadcast on 2 different channels the same time (e.g. a SD and HD channel)

I'm running my TVService with the following changes to Scheduler.cs in function IsEpisodeUnrecorded and it seems to work.

Code:
DateTime pastStart = new DateTime(pastRecordings[i].StartTime.Year, pastRecordings[i].StartTime.Month, pastRecordings[i].StartTime.Day, pastRecordings[i].StartTime.Hour, pastRecordings[i].StartTime.Minute, 0);
if (pastRecordings[i].IsRecording || pastStart != newRecording.Program.StartTime.AddMinutes(-newRecording.Schedule.PreRecordInterval))
{
  ...
 
  ...
  if (fi.Length > 4096 || pastRecordings[i].IsRecording)
  {
    ...
    ...
  }
  ...
}
 

Users who are viewing this thread

Top Bottom