<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 9/11/23 16:10, Philip Brady wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:AS8P193MB1464BBAC8678B3B4795631FCCDF2A@AS8P193MB1464.EURP193.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof"> <br>
      </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 style="font-size: 11pt;
          color: rgb(0, 0, 0);" face="Calibri, sans-serif"><b>From:</b>
          mythtv-users <a class="moz-txt-link-rfc2396E"
            href="mailto:mythtv-users-bounces@mythtv.org"
            moz-do-not-send="true"><mythtv-users-bounces@mythtv.org></a>
          on behalf of Peter Bennett <a class="moz-txt-link-rfc2396E"
            href="mailto:pb.mythtv@gmail.com" moz-do-not-send="true"><pb.mythtv@gmail.com></a><br>
          <b>Sent:</b> 03 September 2023 13:23<br>
          <b>To:</b> <a class="moz-txt-link-abbreviated
            moz-txt-link-freetext" href="mailto:mythtv-users@mythtv.org"
            moz-do-not-send="true">mythtv-users@mythtv.org</a> <a
            class="moz-txt-link-rfc2396E"
            href="mailto:mythtv-users@mythtv.org" moz-do-not-send="true"><mythtv-users@mythtv.org></a><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/3/23 07:03, Philip Brady
          wrote:<br>
        </div>
        <blockquote type="cite">
          <meta name="Generator" content="Microsoft Word 15 (filtered
            medium)">
          <div class="x_WordSection1">
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;">  </p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;">  </p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;"> Sent from <a
                href="https://go.microsoft.com/fwlink/?LinkId=550986"
                data-auth="NotApplicable"
                id="OWAdea03b72-4d69-c35e-cff0-0541db4797fc"
                class="OWAAutoLink" moz-do-not-send="true"> Mail</a> for
              Windows</p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;">  </p>
            <div style="border:none; border-top:solid #E1E1E1 1.0pt;
              padding:3.0pt 0cm 0cm 0cm">
              <p class="x_MsoNormal" style="margin: 0cm; font-size:
                11pt; font-family: Calibri, sans-serif;border:none;
                padding:0cm"> <b>From: </b><a
                  href="mailto:pb.mythtv@gmail.com"
                  id="OWAb3edeffc-3259-b05b-5206-aa22b1f3ebb6"
                  class="OWAAutoLink" moz-do-not-send="true">Peter
                  Bennett</a><br>
                <b>Sent: </b>01 September 2023 21:34<br>
                <b>To: </b><a href="mailto:mythtv-users@mythtv.org"
                  class="x_moz-txt-link-freetext OWAAutoLink
                  moz-txt-link-freetext"
                  id="OWAa6cffab9-d027-6fb3-3683-7eb88002f7bf"
                  moz-do-not-send="true">mythtv-users@mythtv.org</a><br>
                <b>Subject: </b>Re: [mythtv-users] API call
                Guide/GetProgramList broken with port 6744.</p>
            </div>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;">  </p>
            <p> </p>
            <div>
              <p class="x_MsoNormal" style="margin: 0cm; font-size:
                11pt; font-family: Calibri, sans-serif;"> On 9/1/23
                09:46, Philip Brady wrote:</p>
            </div>
            <blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
              <div>
                <p class="x_MsoNormal" style="margin: 0cm; font-size:
                  11pt; font-family: Calibri, sans-serif;"> <span
                    style="font-size: 12pt; color: black;">The API call
                    /Guide/GetProgramList is broken with port 6744.  It
                    does not respect the Details=true parameter. </span></p>
                <div>
                  <p class="x_MsoNormal" style="margin: 0cm; font-size:
                    11pt; font-family: Calibri, sans-serif;"> <span
                      style="font-size: 12pt; color: black;">This breaks
                      portability of my 'split film' utility.</span></p>
                </div>
                <div>
                  <p class="x_MsoNormal" style="margin: 0cm; font-size:
                    11pt; font-family: Calibri, sans-serif;"> <span
                      style="font-size: 12pt; color: black;"> </span></p>
                </div>
                <div>
                  <p class="x_MsoNormal" style="margin: 0cm; font-size:
                    11pt; font-family: Calibri, sans-serif;"> <span
                      style="font-size: 12pt; color: black;">I know that
                      the right course of action for me is to submit a
                      bug, but can anyone point me at a tutorial for
                      doing that please?</span></p>
                </div>
                <div>
                  <p class="x_MsoNormal" style="margin: 0cm; font-size:
                    11pt; font-family: Calibri, sans-serif;"> <span
                      style="font-size: 12pt; color: black;"> </span></p>
                </div>
                <span style="font-size: 12pt; color: black;">...<br>
                </span>
                <div> </div>
                <div>
                  <p class="x_MsoNormal" style="margin: 0cm; font-size:
                    11pt; font-family: Calibri, sans-serif;"> <span
                      style="font-size: 12pt; color: black;">Phil</span></p>
                </div>
                <p class="x_MsoNormal" style="margin: 0cm; font-size:
                  11pt; font-family: Calibri, sans-serif;"> <span
                    style="font-size: 12pt; color: black;"> </span></p>
              </div>
            </blockquote>
            <p>When there is a recording scheduled, the Recording tags
              is filled in. When there is no recording scheduled for
              that program, it is reported as nil.</p>
            <p> </p>
            ...</div>
        </blockquote>
      </div>
    </blockquote>
    <br>
    <blockquote type="cite"
cite="mid:AS8P193MB1464BBAC8678B3B4795631FCCDF2A@AS8P193MB1464.EURP193.PROD.OUTLOOK.COM">
      <div>
        <blockquote type="cite">
          <div class="x_WordSection1"> 
            <p>Can you handle this in your utility?</p>
            <p> </p>
            <p>Peter</p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;">  </p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;"> Thanks Peter.</p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;"> Yes, should be able to
              handle that and I’ll update the documentation accordingly.</p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;"> Would you clarify
              though – is it only the ‘Guide’ APIs or is it applied to
              the ‘Dvr’ ones too?</p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;"> Regards</p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;"> Phil.</p>
            <p class="x_MsoNormal" style="margin: 0cm; font-size: 11pt;
              font-family: Calibri, sans-serif;">  </p>
          </div>
        </blockquote>
        <p>The infrastructure that gets the requests and formats the
          results was rewritten and all of the methods were converted.
          There are minor changes throughout.</p>
        <p>I checked Dvr/GetRecordedList. Artwork is one structure that
          is optional. <br>
        </p>
        <p>In the old API an empty Artwork shows like this</p>
        <p><Artwork><br>
          <ArtworkInfos/><br>
          </Artwork><br>
        </p>
        <p>In the new API an empty Artwork shows like this:</p>
        <p><Artwork xsi:nil="true"/></p>
        <p>In case you want to run comparisons:<br>
        </p>
        <p>In master, versions before v34-Pre-408-gdd35e85329 use port
          6744 for the new api and 6544 for the old.</p>
        <p>Versions after v34-Pre-408-gdd35e85329 use port 6544 for the
          new API and have the old api on port 6550. This old API will
          not be updated and will be removed at some point. Port 6744 is
          also still available and runs the new API.<br>
        </p>
        <p>I hope this helps.</p>
        <p class="elementToProof">Peter<br>
        </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);">
          -------------------------------------</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);">
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US">Hi Peter,<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US">Many thanks for you patience!<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US"><o:p> </o:p></span></p>
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US">Yes, the new interface with no recording info
              can be handled with an application change and I’ve
              included a note about both this and the new backend port
              numbers in the wiki article </span><a
              href="https://www.mythtv.org/wiki/Recording_Status"
              id="OWA7598eed6-055b-1b62-4be6-cc15b945fd33"
              class="OWAAutoLink" moz-do-not-send="true"><span
                style="mso-ansi-language:EN-US" lang="EN-US">https://www.mythtv.org/wiki/Recording_Status</span></a><span
              style="mso-ansi-language:EN-US" lang="EN-US"> <o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US"><o:p> </o:p></span></p>
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US">In time, I’ll also change Perl API examples
              to include the ‘no recording information’ scenario.<span
                style="mso-spacerun:yes">  </span>I suspect that it’s
              only Guide calls which can meaningfully return an empty
              <Recording> section.<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US"><o:p> </o:p></span></p>
          <p class="MsoNoSpacing"><span style="mso-ansi-language:EN-US"
              lang="EN-US">I think there are still two things which are
              still a little unclear and which I’m seeing with </span><span
              style="font-size: 10.5pt; font-family: Arial, sans-serif;
              background: white; color: rgb(37, 37, 37);">v34.0~master.202306020720.ed409bfc02~ubuntu22.04.1
              but a later version may well be more consistent.<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);"><o:p> </o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);">The first is that Backend:6744/Dvr/<a
                moz-do-not-send="true">RecTypeToStrin</a>g?RecType=7 and
              8 both return ‘<a moz-do-not-send="true">Override
                Recording’</a>.<span style="mso-spacerun:yes">  </span>See
              the wiki article.<span style="mso-spacerun:yes">  </span>You
              say that 7 is still useful but 8 is obsolete so I presume
              that Dvr/<a moz-do-not-send="true">RemoveRecordSchedule </a>is
              needed to stop a recording.<span style="mso-spacerun:yes"> 
              </span>Might you ever need to post ’Override Recording’ in
              an UpdateRecordSchedule?<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);"><o:p> </o:p></span></p>
        </div>
      </div>
    </blockquote>
    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.<br>
    <blockquote type="cite"
cite="mid:AS8P193MB1464BBAC8678B3B4795631FCCDF2A@AS8P193MB1464.EURP193.PROD.OUTLOOK.COM">
      <div>
        <div class="elementToProof" style="font-family: Calibri,
          Helvetica, sans-serif; font-size: 12pt; margin-top: 0px;
          margin-bottom: 0px; color: rgb(0, 0, 0);">
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);">It would be clearer if RecTypeToString
              and RecTypeToDescription both returned ‘Unsupported’ for
              unsupported values.<span style="mso-spacerun:yes">  </span>As
              it is, the only practical value for these calls seems to
              be to determine the values and meanings for Type – are
              there any APIs which return a numeric Type?<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);"><o:p> </o:p></span></p>
        </div>
      </div>
    </blockquote>
    We are trying to move away from numeric values for type, status,
    etc. and use strings with meaningful names. I don't know if there
    are APIS that return a numeric type for recording rules. If there
    are we can modify them to have an additional field with the string
    value, which would be the preferred value to use.<br>
    <blockquote type="cite"
cite="mid:AS8P193MB1464BBAC8678B3B4795631FCCDF2A@AS8P193MB1464.EURP193.PROD.OUTLOOK.COM">
      <div>
        <div class="elementToProof" style="font-family: Calibri,
          Helvetica, sans-serif; font-size: 12pt; margin-top: 0px;
          margin-bottom: 0px; color: rgb(0, 0, 0);">
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);">The second issue is status<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);">Backend:6744/Dvr/RecStatusToString?RecStatus=3</span><span
              style="mso-ansi-language:EN-US"> </span><span
              style="font-size: 10.5pt; font-family: Arial, sans-serif;
              background: white; color: rgb(37, 37, 37);"><span
                style="mso-spacerun:yes"> </span>returns ‘<a
                moz-do-not-send="true">Currently Recorded’</a><o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);">ie – you already have this recording on
              your disk.<span style="mso-spacerun:yes">  </span>I think
              that’s a meaningful return value.<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);"><br>
              But entries in my Dvr/ GetUpcomingList have Status=3,
              StatusName=CurrentRecording<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><span style="font-size: 10.5pt;
              font-family: Arial, sans-serif; background: white; color:
              rgb(37, 37, 37);">which suggests that the program is
              currently in the process of being recorded. <span
                style="mso-spacerun:yes"> </span>The examples I’ve seen
              are all recorded already and will not be recorded again so
              a better StatusName would be ‘CurrentlyRecorded’.<span
                style="mso-spacerun:yes">  </span><span
                style="mso-spacerun:yes"> </span>I think this is a bug –
              is it here?<o:p></o:p></span></p>
          <p class="MsoNoSpacing"><a
href="https://github.com/MythTV/mythtv/blob/07439138c378fe07efcee8993721d7e3932ed4c6/mythtv/libs/libmythbase/recordingstatus.h#L11"
              id="OWA073fd6b5-d5e5-01da-c2d2-fb89af3d5508"
              class="OWAAutoLink" moz-do-not-send="true"><span
                style="color: blue;">mythtv/mythtv/libs/libmythbase/recordingstatus.h
                at 07439138c378fe07efcee8993721d7e3932ed4c6 ·
                MythTV/mythtv · GitHub</span></a><o:p></o:p></p>
          <p class="MsoNoSpacing"><o:p> </o:p></p>
        </div>
      </div>
    </blockquote>
    <p>The value CurrentRecording is the actual name in the code for
      value 3 (see
      <a class="moz-txt-link-freetext"
href="https://github.com/MythTV/mythtv/blob/eea10424c0bbe65133120ff2899d20d8068e07f1/mythtv/libs/libmythbase/recordingstatus.h#L35"
        moz-do-not-send="true">https://github.com/MythTV/mythtv/blob/eea10424c0bbe65133120ff2899d20d8068e07f1/mythtv/libs/libmythbase/recordingstatus.h#L35</a>
      ). There are 2 related values PreviousRecording and
      CurrentRecording. PreviousRecording means that you have in the
      past recorded it, watched it and deleted it. CurrentRecording
      means you have recorded it and it is still on your disk. The
      person who originally wrote the code thought this was meaningful.
      The GetUpcomingList now uses a QT feature that lets it get the
      enum name from the value. That way if new values are added to the
      list the programmer does not have to remember to also update the
      API. <br>
    </p>
    <p><br>
    </p>
    <p>Before we knew about the Qt metadata feature that allows this,
      somebody created a method to translate statuses to English, see
      <a class="moz-txt-link-freetext"
href="https://github.com/MythTV/mythtv/blob/eea10424c0bbe65133120ff2899d20d8068e07f1/mythtv/libs/libmythbase/recordingstatus.cpp#L150"
        moz-do-not-send="true">https://github.com/MythTV/mythtv/blob/eea10424c0bbe65133120ff2899d20d8068e07f1/mythtv/libs/libmythbase/recordingstatus.cpp#L150</a>
      . That is what is used in RecStatusToString. The RecStatusToString
      should really be changed and RecStatus::toString should be
      removed. That would make them consistent as CurrentRecording,
      which is not your preference.</p>
    <p><br>
    </p>
    <p>The best way to fix it would be to change the names in the code
      to PreviouslyRecorded and CurrentlyRecorded. However this will
      affect people who already use the API and rely on
      PreviousRecording and CurrentRecording.<br>
    </p>
    <blockquote type="cite"
cite="mid:AS8P193MB1464BBAC8678B3B4795631FCCDF2A@AS8P193MB1464.EURP193.PROD.OUTLOOK.COM">
      <div>
        <div class="elementToProof" style="font-family: Calibri,
          Helvetica, sans-serif; font-size: 12pt; margin-top: 0px;
          margin-bottom: 0px; color: rgb(0, 0, 0);">
          <p class="MsoNoSpacing">Sorry to be so persistent about this –
            I just want help in creating clear documentation.<o:p></o:p></p>
          <p class="MsoNoSpacing"><o:p> </o:p></p>
          <p class="MsoNoSpacing">Regards<o:p></o:p></p>
          <p class="MsoNoSpacing">Phil<o:p></o:p></p>
          <p class="MsoNoSpacing"><o:p> </o:p></p>
          <br>
        </div>
      </div>
      <br>
    </blockquote>
  </body>
</html>