Trigger single recording. How?

Post Reply
PhilB
Senior
Posts: 325
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Trigger single recording. How?

Post by PhilB » Thu Nov 03, 2022 12:39 pm

I have a query about recording rules and the 'Type' parameter.

If I Dvr/GetRecordSchedule with ChanId and StartTime for a program which is not scheduled for recording then it returns a record with 'Type' of 'Not Recording'.
Setting Type to 'Record All' (and also setting Station and LastRecorded) before POSTing a Dvr/AddRecordSchedule triggers a 'Record All'
recording successfully but how do I trigger a single recording?

Dvr/GetRecordScheduleList shows me that I have 332 instances of 'Record All' and one of 'Record Template' in my database.
There are no other 'Type' values so that is probably not the key.

Any advice appreciated.
Phil

User avatar
bill6502
Developer
Posts: 2113
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Trigger single recording. How?

Post by bill6502 » Thu Nov 03, 2022 4:55 pm

TYPES = (
"Single Record",
"Record All",
"Record One",
"Record Daily",
"Record Weekly",
)
From a python tool I wrote ages ago.

PhilB
Senior
Posts: 325
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Trigger single recording. How?

Post by PhilB » Fri Nov 04, 2022 8:05 am

Thanks Bill. You are a star!
The other 'Type' of course is 'Not Recording'.
What's the difference between 'Record One' and 'Single Record'?

A further question please, and it's a general one about the whole API interface.
If you wish to post text which includes the 'odd' characters such as ampersand, do you need to escape them? ' &' not '&' ?
Regards
Phil

User avatar
bill6502
Developer
Posts: 2113
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Trigger single recording. How?

Post by bill6502 » Sun Nov 06, 2022 3:45 pm

This should help. I believe Find One = Record One

I use: TitleRegEx="Penn & Teller: Fool Us", for example with Dvr/GetRecordedList
and it works. We use QUrl::toPercentEncoding in some common API code.

PhilB
Senior
Posts: 325
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Trigger single recording. How?

Post by PhilB » Mon Nov 07, 2022 7:07 pm

Thanks Bill. I have found that when you GET an API it returns values which are encoded (eg & not &).
Writing these back unaltered seems to work so I presume that you only need to encode values in POST operations which have not been obtained from the backend. Probably a rare occurrence.
I'll try and find time to update Perl examples with a 'trigger a recording' example.
Phil

User avatar
bill6502
Developer
Posts: 2113
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Trigger single recording. How?

Post by bill6502 » Sun Nov 20, 2022 5:52 pm

I can't remember if you've tried v2 of the API, but on v32 and master use 6744 in place of 6544
to choose it. Just FYI.

Post Reply