<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> mythtv-users <mythtv-users-bounces@mythtv.org> on behalf of Peter Bennett <pb.mythtv@gmail.com><br>
<b>Sent:</b> 13 September 2023 00:33<br>
<b>To:</b> mythtv-users@mythtv.org <mythtv-users@mythtv.org><br>
<b>Subject:</b> Re: [mythtv-users] API call Guide/GetProgramList broken with port 6744.</font>
<div> </div>
</div>
<div>
<p><br>
</p>
<div class="x_moz-cite-prefix">On 9/12/23 13:13, Philip Brady wrote:<br>
</div>
<blockquote type="cite">
<p class="x_x_MsoNoSpacing x_elementToProof" style="margin-top:0px; margin-bottom:0px">
Sorry but I'm still confused.</p>
<p class="x_x_MsoNoSpacing x_elementToProof" style="margin-top:0px; margin-bottom:0px">
" 7 and 8 are both still in use. The are both overrides, but different types of override. 7 is for a rule that overrides a specific recording to change some values, for example to record one episode into a different recording group. 8 is for a rule that overrides
 a rule and tells MythTV not to record a specific showing of a series. It would make more sense if 8 returned a string like Don't Record. The GetRecordSchedule API returns "Do not Record" if the value is 8.2</p>
<p class="x_x_MsoNoSpacing x_elementToProof" style="margin-top:0px; margin-bottom:0px">
<br>
</p>
<div class="x_x_MsoNoSpacing x_elementToProof x_ContentPasted0" style="margin-top:0px; margin-bottom:0px">
I have always submitted text values for <Type> in <span class="x_ContentPasted0" style="font-size: 12px; display: inline !important; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
</span>UpdateRecordSchedule.  eg 'Record One';</div>
<div class="x_x_MsoNoSpacing x_elementToProof x_ContentPasted0" style="margin-top:0px; margin-bottom:0px">
The text values are the same for both 7 and 8.</div>
<div class="x_x_MsoNoSpacing x_elementToProof x_ContentPasted0" style="margin-top:0px; margin-bottom:0px">
Are you saying that it will also accept both text and numeric values for <Type> ?</div>
<p class="x_x_MsoNoSpacing x_elementToProof" style="margin-top:0px; margin-bottom:0px">
Phil</p>
<p class="x_x_MsoNoSpacing x_elementToProof" style="margin-top:0px; margin-bottom:0px">
<br>
</p>
</blockquote>
<p>UpdateRecordSchedule takes a string for type, not a number. It converts the string to a number for its internal use. It uses recTypeFromString to do that (<a href="https://github.com/MythTV/mythtv/blob/eea10424c0bbe65133120ff2899d20d8068e07f1/mythtv/libs/libmythbase/recordingtypes.cpp#L101" data-auth="NotApplicable" class="x_moz-txt-link-freetext OWAAutoLink" id="OWAf7438661-df55-9f71-7c54-2d595bc30dcd">https://github.com/MythTV/mythtv/blob/eea10424c0bbe65133120ff2899d20d8068e07f1/mythtv/libs/libmythbase/recordingtypes.cpp#L101</a>
 )</p>
<p>You can see from that routine that it allows various options, for example "record all" or "all" (lower case, upper case or mixed) will convert to kAllRecord (4). Note also that the default value if you specify something that is not valid, is kDontRecord.
 If a numeric value was supplied it would be defaulted to kDontRecord.<br>
</p>
<p>A lot of this is not documented, except by looking in the code. Also a lot of it is not ideal. I can fix stuff that is broken or wrong, but I want to avoid doing anything that will break somebody else's use of the APIs.</p>
<p class="elementToProof">Peter</p>
<p class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</p>
<p class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</p>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 0);">
Hi Peter,
<div><br>
</div>
<div>Thanks for your replies.</div>
<div><br>
</div>
<div>Recording Type:</div>
<div>---------------</div>
<div>You say that  "7 is for a rule that overrides a specific recording to change some values, for example to record one episode into a different recording group. 8 is for a rule that overrides a rule and tells MythTV not to record a specific showing of a series."</div>
<div><br>
</div>
<div>That's clear but I'm still puzzled because that distinction is not available to Dvr/UpdateRecordSchedule as it demands a string value.  </div>
<div>If I post an UpdateRecordSchedule with Type=Override Recording will it impose type 7 action or type 8?</div>
<div>What should I post if I want the other one?</div>
<div><br>
</div>
<div>The 'CurrentRecording' issue.</div>
<div>-----------------------------</div>
<div>Having made Status consistent between json and xml (even if it is now numeric!) there is this further incompatibility whereby StatusName gives 'CurrentRecording' but RecStatusToString?RecStatus=3 gives 'Currently Recorded' for upcoming recordings.</div>
<div><br>
</div>
<div>Existing json applications should be unaffected - they will not look at StatusName anyway.</div>
<div><br>
</div>
<div>Existing API/xml applications using this family of calls though are quite different.  Between v33 and v34 they are all thoroughly broken and authors are faced with THREE changes already (more complex tags, missing recording info, numeric status).  Now
 seems as good time as any to impose consistency by changing StatusName to give CurrentlyRecoded rather than CurrentRecording as they will all have to review their code anyway.  It is of course something else to go in the wiki to support them.</div>
<div>Please consider changing it.</div>
<div><br>
</div>
<div>Regards</div>
<div>Phil</div>
<br>
</div>
</div>
</body>
</html>