NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 162 163 164 165 166 … 433 Next »
Recordings have wrong time

Recordings have wrong time
danorum
Offline

Junior Member

Posts: 26
Threads: 4
Joined: Aug 2015
#11
2015-09-28, 08:26 PM (This post was last modified: 2015-09-29, 10:25 PM by danorum.)
I was moving my recordings to a different machine this weekend because I have found myself needing to reboot my main computer when it was recording tv shows. I had the same issue again and used the below code to fix any recording where the recording and the cached event start times were more than 1 hour off.
Code:
List<ScheduledRecording> recordings = new List<ScheduledRecording>();
            recordings = ScheduledRecording.LoadCompleted();            
        foreach (ScheduledRecording recording in recordings)
            {
                if (recording.Filename != "")
                {
                    EPGEvent recEvent = EPGEvent.Parse(recording.CachedEventDetails);
                    TimeSpan difference = recEvent.StartTime - recording.StartTime;
                    if (difference>new TimeSpan(1,0,0))
                    {
                        DateTime starttime = recording.StartTime;
                        DateTime endtime = recording.EndTime;
                        txtfile.WriteLine("imported");
                        recording.StartTime = starttime.AddHours(5); //This is because I am in Central US timezone    
                        recording.EndTime = endtime.AddHours(5); // This is because I am in Central US timezone
                        recording.Save();
                    }
                }
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#12
2015-09-28, 08:30 PM
Is this after reimporting recordings?
danorum
Offline

Junior Member

Posts: 26
Threads: 4
Joined: Aug 2015
#13
2015-09-29, 10:27 PM
sub Wrote:Is this after reimporting recordings?

Yes. After the import, the start time in the recording and the start time in the EPGEvent are not the same (or within a few minutes that would be ok due to padding).

Also, my code snip was missing the line where I get the recevent. (and I copied that from my source and edited the post above)
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failed recordings won't delete Spid4567 3 2,453 2023-07-14, 10:13 PM
Last Post: ZeDoZ
  All my recordings start 90 sec early ncsercs 2 1,355 2022-03-19, 03:28 AM
Last Post: sub
  EPG Time shifi Brucek2839 14 4,071 2021-03-25, 08:45 PM
Last Post: Graham
  Wake - Sleep Interaction -> Failed Recordings mikeh49 48 14,483 2021-03-21, 11:21 PM
Last Post: careads
  Most recordings are zero bytes virtualpaul 4 2,028 2021-01-29, 12:55 PM
Last Post: virtualpaul
  Recording service stopped or not running at scheduled time MattInetroit 3 1,881 2021-01-08, 12:03 AM
Last Post: mvallevand
  Recordings with Next PVR 4.2.5 (CL0116) have background music but no voice in record DavidF 4 2,070 2021-01-07, 08:47 AM
Last Post: sub
  maximize goes to wrong monitor workmanrob 2 1,312 2020-12-27, 03:30 PM
Last Post: workmanrob
  Possible to set the EPG source for more than one channel at a time? LeGrandZombie 15 8,045 2020-12-06, 02:15 AM
Last Post: pitbull1969
  Recordings not playing in browser FamilyGuyFan 1 1,425 2020-10-22, 10:18 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode