Results 1 to 7 of 7

Thread: Scheduling recordings

  1. #1
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,493

    Scheduling recordings

    I am trying to write a command line program to deal with unique_id across and I expect it won't be too difficult, but I have a couple of questions

    1) Is this the right command to use for scheduling unique recordings

    NUtility.ScheduledRecording ScheduleRecording(string name, int channelOID, System.DateTime startTime, System.DateTime endTime, int prePadding, int postPadding, NUtility.RecordingQuality quality, string recordingDirectoryID)

    2) I think these recordings are sticky and I will need to delete them. Is that correct?

    3) If my command line runs in PostEPGUpdate will ScheduleRecording() fail with null on a conflict on that channel or do I have to make sure the time is open?

    (edit)

    4) Do I Cancel or Delete recordings? I thought about it and I guess Cancel is scheduled and Delete removes them when they are not status zero. Right?

    5) To cancel or deletes is it

    Code:
    ;
                int recording_oid = from a lookup;
                ScheduledRecording recording = ScheduledRecording.LoadByOID(recording_oid);
                if (recording != null)
               {
                    ScheduleHelperFactory.GetScheduleHelper().DeleteRecording(recording);
                }


    Thanks,

    Martin
    Last edited by mvallevand; 2012-08-07 at 03:45 AM.

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,556
    Quote Originally Posted by mvallevand View Post
    I am trying to write a command line program to deal with unique_id across and I expect it won't be too difficult, but I have a couple of questions

    1) Is this the right command to use for scheduling unique recordings

    NUtility.ScheduledRecording ScheduleRecording(string name, int channelOID, System.DateTime startTime, System.DateTime endTime, int prePadding, int postPadding, NUtility.RecordingQuality quality, string recordingDirectoryID)
    Yes, you can use that call. This is what is used when you schedule a manual one-off recording.

    2) I think these recordings are sticky and I will need to delete them. Is that correct?
    What do you mean? They'd be one-off recordings, not recurring recordings. Not sure if that is what you're asking though,

    3) If my command line runs in PostEPGUpdate will ScheduleRecording() fail with null on a conflict on that channel or do I have to make sure the time is open?
    Yes, it'd return null if it cant be scheduled.

    (edit)
    4) Do I Cancel or Delete recordings? I thought about it and I guess Cancel is scheduled and Delete removes them when they are not status zero. Right?

    5) To cancel or deletes is it

    Code:
    ;
                int recording_oid = from a lookup;
                ScheduledRecording recording = ScheduledRecording.LoadByOID(recording_oid);
                if (recording != null)
               {
                    ScheduleHelperFactory.GetScheduleHelper().DeleteRecording(recording);
                }
    Yes, you can do that to delete or cancel a recording.

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,493
    Quote Originally Posted by sub View Post
    What do you mean? They'd be one-off recordings, not recurring recordings. Not sure if that is what you're asking though,
    Thanks a lot for the help. For this I just wanted to make sure that I had to be responsible for cancelling them, if they aren't in the next batch.

    Martin

  4. #4
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,493
    Is there something I have to do on the server PC to schedule recordings I can't initiate it

    Code:
                if (ScheduleHelperFactory.GetScheduleHelper() == null)
                {
                    Logger.Debug("What now");
                    return;
                }
    Martin

  5. #5
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,493
    The reason I can't schedule recordings from the command line is I needed a couple of other lines (found in NEWA)

    Code:
                    RecordingServiceProxy.ForceRemote();
                    ScheduleHelperFactory.SetScheduleHelper(RecordingServiceProxy.GetInstance());

    However I still can't run because of the tuner plugin.

    Code:
    2012-08-11 09:36:52.521	[INFO][1]	About to connect to remote recording service
    2012-08-11 09:36:52.523	[DEBUG][1]	RecordingServiceProxy@exit
    2012-08-11 09:36:52.554	[ERROR][1]	Specified capture plugin not found: NetworkRecorder.NetworkRecorder
    2012-08-11 09:36:52.554	[ERROR][1]	Specified capture plugin not found: NetworkRecorder.NetworkRecorder
    How can I force a command line program to load this? NEWA seems to work ok and load the plugins

    Code:
    2012-08-11 08:12:24.187	[INFO][3]	About to connect to remote recording service
    2012-08-11 08:12:24.219	[DEBUG][3]	RecordingServiceProxy@exit
    2012-08-11 08:12:24.248	[DEBUG][3]	About to look for plugin directories in: C:\Users\Public\NPVR\Plugins\
    ...
    Martin

  6. #6
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,556
    You probably also need to call (NUtility) PluginRegistry.LoadPlugins().

    This call and the one you mentioned above were never really intended to be used by developers though, so I reserve the right to unintentionally break them in the future

  7. #7
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,493
    Great that works nicely, it also shows an error that I was meaning to post for whurlston and ACTCMS that I get when I run the --updateepg command line version.

    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •