Difference between revisions of "DVR Service"

From MythTV Official Wiki
Jump to: navigation, search
(Intro)
m (Links to Recording Status added)
 
(35 intermediate revisions by 9 users not shown)
Line 8: Line 8:
 
<center>
 
<center>
 
{| cellpadding="4" border="1"
 
{| cellpadding="4" border="1"
| align="center"  |<b>API Command</b>
+
| align="center"  |'''API Command'''
| align="center"  |<b>POST Required?</b>
+
| align="center"  |'''Service Version'''
| align="center"  |<b>Description</b>
+
| align="center"  |'''POST Required?'''
 +
| align="center"  |'''Description'''
 
|-  
 
|-  
 
| [[DVR_Service#GetUpcomingList | GetUpcomingList]]
 
| [[DVR_Service#GetUpcomingList | GetUpcomingList]]
 +
| align="center" | ?
 
| align="center"  | No
 
| align="center"  | No
 
| Query information on all upcoming programs matching recording rules.
 
| Query information on all upcoming programs matching recording rules.
 
|-  
 
|-  
 
| style="background:silver" | [[DVR_Service#GetExpiringList | GetExpiringList]]
 
| style="background:silver" | [[DVR_Service#GetExpiringList | GetExpiringList]]
 +
| style="background:silver" align="center" | ?
 
| style="background:silver" align="center" | No
 
| style="background:silver" align="center" | No
 
| style="background:silver" | Query information on recorded programs which are set to expire.
 
| style="background:silver" | Query information on recorded programs which are set to expire.
 
|-  
 
|-  
 
| [[DVR_Service#GetRecordedList | GetRecordedList]]
 
| [[DVR_Service#GetRecordedList | GetRecordedList]]
 +
| align="center" | ?
 
| align="center"  | No
 
| align="center"  | No
 
| Query information on all recorded programs.
 
| Query information on all recorded programs.
 
|-  
 
|-  
 
| style="background:silver" | [[DVR_Service#GetRecorded | GetRecorded]]
 
| style="background:silver" | [[DVR_Service#GetRecorded | GetRecorded]]
 +
| style="background:silver" align="center" | ?
 
| style="background:silver" align="center" | No
 
| style="background:silver" align="center" | No
 
| style="background:silver" | Query information on a single item from recordings.
 
| style="background:silver" | Query information on a single item from recordings.
 +
|-
 +
| [[DVR_Service#AddRecordedCredits | AddRecordedCredits]]
 +
| align="center" | 7.0
 +
| align="center" | Yes
 +
| Add credits to a currently recorded program.
 +
|-
 +
| style="background:silver" | [[DVR_Service#AddRecordedProgram | AddRecordedProgram]]
 +
| style="background:silver" align="center" | 7.0
 +
| style="background:silver" align="center" | Yes
 +
| style="background:silver" | Add a recorded program entry into MythTV.
 
|-  
 
|-  
 
| [[DVR_Service#GetConflictList | GetConflictList]]
 
| [[DVR_Service#GetConflictList | GetConflictList]]
 +
| align="center" | ?
 
| align="center" | No
 
| align="center" | No
 
| Query information on upcoming items which will not record due to conflicts.
 
| Query information on upcoming items which will not record due to conflicts.
 
|-  
 
|-  
 
| style="background:silver" |[[DVR_Service#RemoveRecorded | RemoveRecorded]]
 
| style="background:silver" |[[DVR_Service#RemoveRecorded | RemoveRecorded]]
 +
| style="background:silver" align="center" | ?
 
| style="background:silver" align="center" | Yes
 
| style="background:silver" align="center" | Yes
| style="background:silver" | Remove a Recording from the database and disk.
+
| style="background:silver" | Delete a Recording (deprecated, replaced by DeleteRecording in later versions)
 
|-  
 
|-  
 
| [[DVR_Service#GetEncoderList | GetEncoderList]]
 
| [[DVR_Service#GetEncoderList | GetEncoderList]]
 +
| align="center" | ?
 
| align="center" | No
 
| align="center" | No
 
| Query information on configured capture devices, and their current activity.
 
| Query information on configured capture devices, and their current activity.
 
|-  
 
|-  
 
| style="background:silver" |[[DVR_Service#RemoveRecordSchedule | RemoveRecordSchedule]]
 
| style="background:silver" |[[DVR_Service#RemoveRecordSchedule | RemoveRecordSchedule]]
 +
| style="background:silver" align="center" | ?
 
| style="background:silver" align="center" | Yes
 
| style="background:silver" align="center" | Yes
 
| style="background:silver" | Remove a Recording rule.
 
| style="background:silver" | Remove a Recording rule.
 
|-  
 
|-  
 
| [[DVR_Service#GetRecordScheduleList | GetRecordScheduleList]]
 
| [[DVR_Service#GetRecordScheduleList | GetRecordScheduleList]]
 +
| align="center" | ?
 
| align="center" | No
 
| align="center" | No
 
| Query all configured recording rules, and return them in a list.
 
| Query all configured recording rules, and return them in a list.
 
|-  
 
|-  
 
| style="background:silver" |[[DVR_Service#GetRecordSchedule | GetRecordSchedule]]
 
| style="background:silver" |[[DVR_Service#GetRecordSchedule | GetRecordSchedule]]
 +
| style="background:silver" align="center" | ?
 
| style="background:silver" align="center" | No
 
| style="background:silver" align="center" | No
 
| style="background:silver" | Return a single recording rule, by record id.
 
| style="background:silver" | Return a single recording rule, by record id.
 +
|-
 +
| style="background:silver" |[[DVR_Service#AddRecordSchedule | AddRecordSchedule]]
 +
| style="background:silver" align="center" | ?
 +
| style="background:silver" align="center" | Yes
 +
| style="background:silver" | Add a single recording rule, by record id.
 +
|-
 +
| style="background:silver" |[[DVR_Service#UpdateRecordSchedule | UpdateRecordSchedule]]
 +
| style="background:silver" align="center" | ?
 +
| style="background:silver" align="center" | Yes
 +
| style="background:silver" | Update a single recording rule, by record id.
 
|-  
 
|-  
 
| [[DVR_Service#EnableRecordSchedule | EnableRecordSchedule]]
 
| [[DVR_Service#EnableRecordSchedule | EnableRecordSchedule]]
 +
| align="center" | ?
 
| align="center" | Yes
 
| align="center" | Yes
 
| Enable a recording schedule, by record id.
 
| Enable a recording schedule, by record id.
 
|-  
 
|-  
 
| style="background:silver" |[[DVR_Service#DisableRecordSchedule | DisableRecordSchedule]]
 
| style="background:silver" |[[DVR_Service#DisableRecordSchedule | DisableRecordSchedule]]
 +
| style="background:silver" align="center" | ?
 
| style="background:silver" align="center" | Yes
 
| style="background:silver" align="center" | Yes
 
| style="background:silver" | Disable a recording schedule, by record id.
 
| style="background:silver" | Disable a recording schedule, by record id.
 +
|-
 +
| [[DVR_Service#DeleteRecording | DeleteRecording]]
 +
| align="center" | 6.0
 +
| align="center" | Yes
 +
| Delete a recording, by recording id
 +
|-
 +
| style="background:silver" |[[DVR_Service#UnDeleteRecording | UnDeleteRecording]]
 +
| style="background:silver" align="center" | 6.0
 +
| style="background:silver" align="center" | Yes
 +
| style="background:silver" | Un-delete a recording, by recording id
 +
|-
 +
| [[DVR_Service#UpdateRecordedWatchedStatus | UpdateRecordedWatchedStatus]]
 +
| align="center" | 6.0
 +
| align="center" | Yes
 +
| Mark a recording watched, or unwatched, by recording id
 +
|-
 +
| style="background:silver" |[[DVR_Service#StopRecording | StopRecording]]
 +
| style="background:silver" align="center" | 6.3
 +
| style="background:silver" align="center" | Yes v32+
 +
| style="background:silver" | Stop a current recording, by recording id
 +
|-
 +
| [[DVR_Service#ReactivateRecording | ReactivateRecording]]
 +
| align="center" | 6.3
 +
| align="center" | Yes v32+
 +
| Reactivate a stopped recording, by recording id
 +
|-
 +
| style="background:silver" |[[DVR_Service#RescheduleRecordings | RescheduleRecordings]]
 +
| style="background:silver" align="center" | 6.3
 +
| style="background:silver" align="center" | Yes v32+
 +
| style="background:silver" | Trigger a reschedule
 +
|-
 +
| [[DVR_Service#RecordedIdForPathname | RecordedIdForPathname]]
 +
| align="center" | 6.3
 +
| align="center" | No
 +
| Retrieve the recording id for given a recording file name
 +
|-
 +
| style="background:silver" |[[DVR_Service#GetRecordedMarkup | GetRecordedMarkup]]
 +
| style="background:silver" align="center" | 7.0
 +
| style="background:silver" align="center" | No
 +
| style="background:silver" |Retrieve the complete markup and seek tables by Recorded Id
 +
|-
 +
| [[DVR_Service#SetRecordedMarkup| SetRecordedMarkup]]
 +
| align="center" | 7.0
 +
| align="center" | Yes
 +
| Set the markup and seek tables for the given Recorded Id
 +
|-
 +
| style="background:silver" |[[DVR_Service#GetRecordedSeek | GetRecordedSeek]]
 +
| style="background:silver" align="center" | 6.3
 +
| style="background:silver" align="center" | No
 +
| style="background:silver" |Retrieve the seektable, by recording id and type
 +
|-
 +
| [[DVR_Service#ManageJobQueue | ManageJobQueue]]
 +
| align="center" | 6.6
 +
| align="center" | Yes
 +
| Administer User, Commflag and Metadata jobs
 +
|-
 +
| style="background:silver" |[[DVR_Service#AddDontRecordSchedule | AddDontRecordSchedule]]
 +
| style="background:silver" align="center" | ?
 +
| style="background:silver" align="center" | Yes v32+
 +
| style="background:silver" |Don't record a given program, optionally: never record
 +
|-
 
|}
 
|}
 
</center>
 
</center>
Line 158: Line 252:
 
             <DupMethod>6</DupMethod>
 
             <DupMethod>6</DupMethod>
 
             <EncoderId>0</EncoderId>
 
             <EncoderId>0</EncoderId>
             <Profile>Default</Profile>
+
             <Profile>Default</Profile>https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
 
         </Recording>
 
         </Recording>
 
     </Program>
 
     </Program>
 
</Programs>
 
</Programs>
 
</ProgramList></pre>
 
</ProgramList></pre>
 +
 +
See  https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.
  
 
==GetExpiringList==
 
==GetExpiringList==
Line 212: Line 308:
 
         <Season>1</Season>
 
         <Season>1</Season>
 
         <Episode>9</Episode>
 
         <Episode>9</Episode>
         <Channel>
+
         <Channel>https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
 
             <ChanId>34736</ChanId>
 
             <ChanId>34736</ChanId>
 
             <ChanNum>736</ChanNum>
 
             <ChanNum>736</ChanNum>
Line 259: Line 355:
 
</Programs>
 
</Programs>
 
</ProgramList></pre>
 
</ProgramList></pre>
 +
See https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.
  
 
==GetRecordedList==
 
==GetRecordedList==
Line 275: Line 372:
 
:: '''Parameter Type:''' Boolean
 
:: '''Parameter Type:''' Boolean
 
:: Controls whether results are returned in forward or reverse chronological order.
 
:: Controls whether results are returned in forward or reverse chronological order.
 +
 +
:<span style="color:SteelBlue">TitleRegEx</Span> ('''Optional''')
 +
:: '''Parameter Type:''' String
 +
:: Filter the result to recordings with titles matching the regular expression
 +
 +
:<span style="color:SteelBlue">RecGroup</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Boolean
 +
:: Filter the result to recordings in the matching recording group.
 +
 +
:<span style="color:SteelBlue">StorageGroup</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Boolean
 +
:: Filter the result to recordings in the matching storage group.
  
 
Example Query:
 
Example Query:
Line 359: Line 468:
 
</Programs>
 
</Programs>
 
</ProgramList></pre>
 
</ProgramList></pre>
 +
See https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.
 +
 +
Note that the ProgramFlags are listed here:  https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
  
 
==GetRecorded==
 
==GetRecorded==
Line 364: Line 476:
 
The <span style="color:LimeGreen">GetRecorded</span> API takes the following arguments:
 
The <span style="color:LimeGreen">GetRecorded</span> API takes the following arguments:
  
:<span style="color:SteelBlue">ChanId</Span> ('''Required''')
+
:<span style="color:SteelBlue">ChanId</Span> ('''Required''')Note that the ProgramFlags are listed here:  https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
 
:: '''Parameter Type:''' Integer
 
:: '''Parameter Type:''' Integer
 
:: The database channel id for the guide item.
 
:: The database channel id for the guide item.
Line 372: Line 484:
 
:: The recording start time for the item.  This should be in MySQL ISO format, eg: 2011-08-29 18:59:00.  You can replace the space with %20 or T.
 
:: The recording start time for the item.  This should be in MySQL ISO format, eg: 2011-08-29 18:59:00.  You can replace the space with %20 or T.
  
 +
'''From 0.28''' or '''service version 6.0''' you may use the recording ID instead of ChanId/StartTime:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Optionally Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 
Example Query:
 
Example Query:
  
 
<code>http://BackendServerIP:6544/Dvr/GetRecorded?StartTime=2011-10-03T19:00:00&ChanId=2066</code>
 
<code>http://BackendServerIP:6544/Dvr/GetRecorded?StartTime=2011-10-03T19:00:00&ChanId=2066</code>
 +
 +
''NB It would appear that the StartTime parameter is not the scheduled time of a program but the time the recording actually started; typically a few minutes earlier.  This required value is found in <StartTS> as returned by GetRecordedList and not <StartTime>.
 +
''
 +
  
 
Example Return:
 
Example Return:
Line 446: Line 567:
 
     </Recording>
 
     </Recording>
 
</Program>
 
</Program>
 +
</pre>
 +
Note that the ProgramFlags are listed here:  https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
 +
See https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.
 +
 +
==AddRecordedCredits==
 +
 +
The <span style="color:LimeGreen">AddRecordedCredits</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The Recorded id for the recorded program to add the credits to.
 +
 +
:: The Post body of the message needs to contain the json list of credits to add in the same format of CastMembers returned by the GetRecording API call
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/AddRecordedCredits?RecordedId=2066</code>
 +
 +
The query needs Content-Type: application/json when passing a json body
 +
 +
To test using curl:
 +
 +
<pre>
 +
curl -X POST -H "Content-Type: application/json" "http://rocinante:6744/Dvr/AddRecordedCredits?RecordedId=24"
 +
-d '
 +
** INSERT POST BODY HERE **
 +
'
 
</pre>
 
</pre>
 +
 +
Post body:
 +
<pre>
 +
{
 +
  "CastMembers": [
 +
    {
 +
      "Name": "Alan Davies",
 +
      "CharacterName": "Jonathan Creek",
 +
      "Role": "actor",
 +
      "TranslatedRole": "Actors"
 +
    },
 +
    {
 +
      "Name": "Caroline Quentin",
 +
      "CharacterName": "Maddy Magellan",
 +
      "Role": "actor",
 +
      "TranslatedRole": "Actors"
 +
    },
 +
    {
 +
      "Name": "Julia Sawalha",
 +
      "CharacterName": "Carla Borrego",
 +
      "Role": "actor",
 +
      "TranslatedRole": "Actors"
 +
    },
 +
    {
 +
      "Name": "Stuart Milligan",
 +
      "CharacterName": "Adam Klaus",
 +
      "Role": "actor",
 +
      "TranslatedRole": "Actors"
 +
    }
 +
  ]
 +
}
 +
</pre>
 +
 +
==AddRecordedProgram==
 +
 +
The <span style="color:LimeGreen">AddRecordedProgram</span> API requires a POST body containing the same json format returned by GetRecording:
 +
<pre>
 +
{
 +
  "Program": {
 +
    "StartTime": "2021-04-12T04:00:00Z",
 +
    "EndTime": "2021-04-12T05:00:00Z",
 +
    "Title": "The Rookie",
 +
    "SubTitle": "Man of Honor",
 +
    "Category": "Crime drama",
 +
    "CatType": "series",
 +
    "Repeat": "false",
 +
    "VideoProps": "71",
 +
    "VideoPropNames": "WIDESCREEN|HDTV|MPEG2|1080",
 +
    "AudioProps": "8",
 +
    "AudioPropNames": "DOLBY",
 +
    "SubProps": "2",
 +
    "SubPropNames": "NORMAL",
 +
    "SeriesId": "EP02970543",
 +
    "ProgramId": "EP029705430051",
 +
    "Stars": "0",
 +
    "LastModified": "2021-04-12T05:01:16Z",
 +
    "ProgramFlags": "1",
 +
    "ProgramFlagNames": "COMMFLAG",
 +
    "Airdate": "2021-04-11",
 +
    "Description": "Harper and Nolan respond to a bank robbery in progress and realize the motives of the thief run much deeper than just needing money; Jackson and Chen's first day riding without training officers isn't what they though>
 +
    "Inetref": "ttvdb.py_350665",
 +
    "Season": "3",
 +
    "Episode": "10",
 +
    "TotalEpisodes": "0",
 +
    "FileSize": "5446351164",
 +
    "FileName": "11401_20210412030000.ts",
 +
    "HostName": "sapphire",
 +
    "Channel": {
 +
      "ChanId": "11401",
 +
      "ChanNum": "14_1",
 +
      "CallSign": "KTTR-DT",
 +
      "IconURL": "/Guide/GetChannelIcon?ChanId=11401",
 +
      "ChannelName": "KTTR-DT",
 +
      "MplexId": "1",
 +
      "ServiceId": "3",
 +
      "ATSCMajorChan": "14",
 +
      "ATSCMinorChan": "1",
 +
      "Format": "ATSC",
 +
      "FrequencyId": "7",
 +
      "FineTune": "0",
 +
      "ChanFilters": "",
 +
      "SourceId": "1",
 +
      "InputId": "0",
 +
      "CommFree": "false",
 +
      "UseEIT": "true",
 +
      "Visible": "true",
 +
      "ExtendedVisible": "Visible",
 +
      "XMLTVID": "I34215.json.schedulesdirect.org",
 +
      "DefaultAuth": "",
 +
      "ChannelGroups": "",
 +
      "Inputs": "",
 +
      "ServiceType": "0",
 +
      "Programs": []
 +
    },
 +
    "Recording": {
 +
      "RecordedId": "37729",
 +
      "Status": "-3",
 +
      "Priority": "0",
 +
      "StartTs": "2021-04-12T04:00:00Z",
 +
      "EndTs": "2021-04-12T05:01:15Z",
 +
      "FileSize": "5446351164",
 +
      "FileName": "11401_20210412030000.ts",
 +
      "HostName": "empire",
 +
      "LastModified": "2021-04-12T05:01:16Z",
 +
      "RecordId": "8207",
 +
      "RecGroup": "Series",
 +
      "PlayGroup": "Default",
 +
      "StorageGroup": "Default",
 +
      "RecType": "0",
 +
      "DupInType": "15",
 +
      "DupMethod": "6",
 +
      "EncoderId": "0",
 +
      "EncoderName": "quad1",
 +
      "Profile": "Default",
 +
    },
 +
    "Artwork": {
 +
      "ArtworkInfos": [
 +
        {
 +
          "URL": "/Content/GetImageFile?StorageGroup=Coverart&FileName=%2FThe%20Rookie%20Season%203_coverart.jpg",
 +
          "FileName": "myth://Coverart@sapphire/The Rookie Season 3_coverart.jpg",
 +
          "StorageGroup": "Coverart",
 +
          "Type": "coverart"
 +
        },
 +
        {
 +
          "URL": "/Content/GetImageFile?StorageGroup=Fanart&FileName=%2FThe%20Rookie%20Season%203_fanart.jpg",
 +
          "FileName": "myth://Fanart@sapphire/The Rookie Season 3_fanart.jpg",
 +
          "StorageGroup": "Fanart",
 +
          "Type": "fanart"
 +
        }
 +
      ]
 +
    },
 +
    "Cast": {
 +
      "CastMembers": [
 +
        {
 +
          "Name": "Nathan Fillion",
 +
          "CharacterName": "John Nolan",
 +
          "Role": "actor",
 +
          "TranslatedRole": "Actors"
 +
        },
 +
        {
 +
          "Name": "Mekia Cox",
 +
          "CharacterName": "Nyla Harper",
 +
          "Role": "actor",
 +
          "TranslatedRole": "Actors"
 +
        },
 +
          "Name": "Alyssa Diaz",
 +
          "CharacterName": "Angela Lopez",
 +
          "Role": "actor",
 +
          "TranslatedRole": "Actors"
 +
        },
 +
        {
 +
          "Name": "Richard T. Jones",
 +
          "CharacterName": "Sergeant Wade Grey",
 +
          "Role": "actor",
 +
          "TranslatedRole": "Actors"
 +
        },
 +
        {
 +
          "Name": "Titus Makin",
 +
          "CharacterName": "Jackson West",
 +
          "Role": "actor",
 +
          "TranslatedRole": "Actors"
 +
        },
 +
        {
 +
          "Name": "Melissa O'Neil",
 +
          "CharacterName": "Lucy Chen",
 +
          "Role": "actor",
 +
          "TranslatedRole": "Actors"
 +
        }
 +
      ]
 +
    }
 +
  }
 +
}
 +
</pre>
 +
See https://www.mythtv.org/wiki/Recording_Status for a discussion on recording Status and type.
  
 
==GetConflictList==
 
==GetConflictList==
Line 535: Line 857:
 
</Program>
 
</Program>
 
</pre>
 
</pre>
 +
See https://www.mythtv.org/wiki/Recording_Status for a discussion on recording Status and type.
 +
 +
==RemoveRecorded==
 +
 +
The <span style="color:LimeGreen">RemoveRecord</span> API is available in DVR Service versions prior to 2.1. It was renamed in 2.1 to <span style="color:LimeGreen">DeleteRecording</span>
 +
 +
See the documentation for <span style="color:LimeGreen">DeleteRecording</span>
 +
 +
==DeleteRecording==
 +
[v2.1+] The <span style="color:LimeGreen">DeleteRecording</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">ChanId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database channel id for the guide item.
 +
 +
:<span style="color:SteelBlue">StartTime</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The recording start time for the item.  This should be in MySQL ISO format, eg: 2011-08-29 18:59:00.  You can replace the space with %20 or T.
 +
 +
[v6.0+] '''From 0.28''' you may use the recording ID instead of ChanId/StartTime:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Optionally Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 +
 +
:<span style="color:SteelBlue">AllowRerecord</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Boolean
 +
:: Allow the program to be recorded again.
 +
 +
:<span style="color:SteelBlue">ForceDelete</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Boolean
 +
:: Force deletion of metadata (e.g. if the recording itself doesn't exist.)
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/DeleteRecording?StartTime=2011-10-03T19:00:00&ChanId=2066</code>
 +
<code>http://BackendServerIP:6544/Dvr/DeleteRecording?RecordedId=1234</code>
 +
 +
==UnDeleteRecording==
 +
[v6.0+] The <span style="color:LimeGreen">UnDeleteRecording</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Optionally Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/UnDeleteRecording?StartTime=2011-10-03T19:00:00&ChanId=2066</code>
 +
<code>http://BackendServerIP:6544/Dvr/UnDeleteRecording?RecordedId=1234</code>
 +
 +
==StopRecording==
 +
[v6.3+] The <span style="color:LimeGreen">StopRecording</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/StopRecording?RecordedId=1234</code>
 +
 +
==ReactivateRecording==
 +
[v6.3+] The <span style="color:LimeGreen">ReactivateRecording</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/ReactivateRecording?RecordedId=1234</code>
 +
 +
==RescheduleRecordings==
 +
[v6.3+] The <span style="color:LimeGreen">RescheduleRecordings</span> API does not take any arguments.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/RescheduleRecordings</code>
 +
 +
==UpdateRecordedWatchedStatus==
 +
[v6.0+] The <span style="color:LimeGreen">UpdateRecordedWatchedStatus</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 +
 +
:<span style="color:SteelBlue">Watched</Span> ('''Required''')
 +
:: '''Parameter Type:''' Boolean
 +
:: Recording watched? True/False
 +
 +
Example Query:
 +
<code>http://BackendServerIP:6544/Dvr/UpdateRecordedWatchedStatus?RecordedId=1234&Watched=true</code>
  
 
==GetEncoderList==
 
==GetEncoderList==
Line 626: Line 1,036:
 
</EncoderList>
 
</EncoderList>
 
</pre>
 
</pre>
 +
 +
See [https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/tv.h#L48] for the possible State values
  
 
==RemoveRecordSchedule==
 
==RemoveRecordSchedule==
Line 727: Line 1,139:
  
 
==GetRecordSchedule==
 
==GetRecordSchedule==
 +
==AddRecordSchedule==
 +
==UpdateRecordSchedule==
  
 
The <span style="color:LimeGreen">GetRecordSchedule</span> API takes the following arguments:
 
The <span style="color:LimeGreen">GetRecordSchedule</span> API takes the following arguments:
  
 +
===Old Style===
 
:<span style="color:SteelBlue">RecordId</Span> ('''Required''')
 
:<span style="color:SteelBlue">RecordId</Span> ('''Required''')
 
:: '''Parameter Type:''' Integer
 
:: '''Parameter Type:''' Integer
 
:: The Recording rule ID for the rule to be looked up.
 
:: The Recording rule ID for the rule to be looked up.
 +
 +
===New Style===
 +
<pre>
 +
Returns: RecRule
 +
Parameters:
 +
xs:unsignedInt RecordId
 +
xs:string Template
 +
xs:int         ChanId
 +
xs:dateTime StartTime
 +
xs:boolean MakeOverride
 +
</pre>
 +
 +
GetRecordSchedule() provides rules suitable for later calls to AddRecordSchedule() and UpdateRecordSchedule().  When given a valid RecordId, GetRecordSchedule() returns that rule.  When given a Template name, GetRecordSchedule() returns an empty rule initialized with that template.  When given a ChanId and StartTime, GetRecordSchedule() returns the rule for that program or a new one if no rule currently exists.  If the MakeOverride parameter is true, the returned rule for the program will converted to an override rule if
 +
needed.
 +
 +
Clients should always call GetRecordSchedule() with the appropriate parameters before modifying the rule and then calling AddRecordSchedule() or UpdateRecordSchedule().  In this way, clients do not need to know all of the details on how to initialize rules or update them for specific programs.
 +
 +
When feeding a new RecRule into AddRecordSchedule() you'll need to set the Station parameter equal to CallSign and modify the Type parameter to something beside "Not Recording"
 +
 +
See this commit: [[https://github.com/MythTV/mythtv/commit/2865936]] for additional information.
 +
Also see https://www.mythtv.org/wiki/Recording_Status for a discussion on recording Status and type.
  
 
Example Query:
 
Example Query:
Line 790: Line 1,226:
 
</RecRule>
 
</RecRule>
 
</pre>
 
</pre>
 +
 
==EnableRecordSchedule==
 
==EnableRecordSchedule==
  
Line 829: Line 1,266:
 
<bool>true</bool>
 
<bool>true</bool>
 
</pre>
 
</pre>
 +
 +
==RecordedIdForPathname==
 +
 +
The <span style="color:LimeGreen">RecordedIdForPathname</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Pathname</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: basename, or full path of a recorded file.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/RecordedIdForPathname?Pathname=1050_20160912221500.ts</code>
 +
 +
Returns an integer, representing the RecordedId.
 +
 +
<pre>
 +
<int>1234</int>
 +
</pre>
 +
 +
==GetRecordedMarkup==
 +
 +
The <span style="color:LimeGreen">GetRecordedMarkup</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database Recorded Id for the recording.
 +
 +
The result is a complete dump of the mythconverg.recordedseek and mythconverg.recordedmarkup tables:
 +
 +
<code>http://BackendServerIP:6544/Dvr/GetRecordedMarkup?RecordedId=539</code>
 +
 +
<pre>
 +
{
 +
        "MarkupList": {
 +
          "Mark": [
 +
            {
 +
              "Type": "UPDATED_CUT",
 +
              "Frame": "0",
 +
              "Data": "NULL"
 +
            },
 +
            {
 +
              "Type": "DURATION_MS",
 +
              "Frame": "0",
 +
              "Data": "3675000"
 +
            },
 +
            {
 +
              "Type": "TOTAL_FRAMES",
 +
              "Frame": "0",
 +
              "Data": "93271"
 +
            },
 +
            {
 +
              "Type": "ASPECT_16_9",
 +
              "Frame": "1",
 +
              "Data": "NULL"
 +
            },
 +
            {
 +
              "Type": "VIDEO_WIDTH",
 +
              "Frame": "1",
 +
              "Data": "1920"
 +
            },
 +
            {
 +
              "Type": "VIDEO_HEIGHT",
 +
              "Frame": "1",
 +
              "Data": "1080"
 +
            },
 +
            {
 +
              "Type": "VIDEO_RATE",
 +
              "Frame": "1",
 +
              "Data": "29970"
 +
            },
 +
            {
 +
              "Type": "UTIL_PROGSTART",
 +
              "Frame": "736",
 +
              "Data": "NULL"
 +
            },
 +
            {
 +
              "Type": "COMM_START",
 +
              "Frame": "18996",
 +
              "Data": "NULL"
 +
            },
 +
            {
 +
              "Type": "COMM_END",
 +
              "Frame": "23385",
 +
              "Data": "NULL"
 +
            },
 +
              "Type": "COMM_START",
 +
              "Frame": "50981",
 +
              "Data": "NULL"
 +
            },
 +
            {
 +
              "Type": "COMM_END",
 +
              "Frame": "57557",
 +
              "Data": "NULL"
 +
            },
 +
            {
 +
              "Type": "COMM_START",
 +
              "Frame": "89741",
 +
              "Data": "NULL"
 +
            },
 +
            {
 +
              "Type": "COMM_END",
 +
              "Frame": "93539",
 +
              "Data": "NULL"
 +
            }
 +
          ],
 +
          "Seek": [
 +
            {
 +
              "Type": "GOP_BYFRAME",
 +
              "Frame": "0",
 +
              "Data": "376"
 +
            },
 +
            {
 +
              "Type": "DURATION_MS",
 +
              "Frame": "0",
 +
              "Data": "0"
 +
            },
 +
            {
 +
              "Type": "GOP_BYFRAME",
 +
              "Frame": "45",
 +
              "Data": "2202608"
 +
            },
 +
            {
 +
              "Type": "DURATION_MS",
 +
              "Frame": "45",
 +
              "Data": "1502"
 +
            },
 +
            {
 +
              "Type": "GOP_BYFRAME",
 +
              "Frame": "90",
 +
              "Data": "4544148"
 +
            },
 +
</pre>
 +
Results truncated.
 +
 +
==SetRecordedMarkup==
 +
 +
The <span style="color:LimeGreen">SetRecordedMarkup</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 +
 +
Example:
 +
 +
<code>http://BackendServerIP:6544/Dvr/GetRecordedMarkup?RecordedId=539</code>
 +
 +
The body of the POST message must be in the same json format as returned by the GetRecordedMarkup API call. See above for example.
 +
 +
==GetRecordedSeek==
 +
 +
The <span style="color:LimeGreen">GetRecordedSeek</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">RecordedId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database recordedid for the recording.
 +
 +
:<span style="color:SteelBlue">OffsetType</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: Either 'BYTES' or 'DURATION'
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Dvr/GetRecordedSeek?RecordedId=449&OffsetType=BYTES</code>
 +
 +
Returns: A 'cut' mapping.  The element names could be more descriptive, but match the format of the GetRecordedCutList and GetRecordedCommBreak API calls to allow code re-use.
 +
 +
<pre>
 +
<CutList version="1.0" serializerVersion="1.1">
 +
    <Cuttings>
 +
        <Cutting>
 +
            <Mark>0</Mark>
 +
            <Offset>0</Offset>
 +
        </Cutting>
 +
        <Cutting>
 +
            <Mark>1</Mark>
 +
            <Offset>1227264</Offset>
 +
        </Cutting>
 +
        <Cutting>
 +
            <Mark>2</Mark>
 +
            <Offset>2454528</Offset>
 +
        </Cutting>
 +
    </Cuttings>
 +
</CutList>
 +
</pre>
 +
 +
Or
 +
 +
<pre>
 +
<CutList version="1.0" serializerVersion="1.1">
 +
    <Cuttings>
 +
        <Cutting>
 +
            <Mark>0</Mark>
 +
            <Offset>0</Offset>
 +
        </Cutting>
 +
        <Cutting>
 +
            <Mark>1</Mark>
 +
            <Offset>500</Offset>
 +
        </Cutting>
 +
        <Cutting>
 +
            <Mark>2</Mark>
 +
            <Offset>1000</Offset>
 +
        </Cutting>
 +
    </Cuttings>
 +
</CutList>
 +
</pre>
 +
 +
==ManageJobQueue==
 +
{{ServicesApiParam|name=Action|required=Required|type=String|comment=Either Add or Remove}}
 +
{{ServicesApiParam|name=JobName|required=Required|type=String|comment=UserJob<1-4>, Commflag, Metadata}}
 +
{{ServicesApiParam|name=JobId|required=Required for Remove|type=Integer|comment=Job Queue ID}}
 +
{{ServicesApiParam|name=RecordedId|required=Required|type=Integer|comment=Id of the recording to act on}}
 +
{{ServicesApiParam|name=JobStartTime|required=Optional for Add, defaults to current time|type=Time Stamp|comment=Full timestame, e.g. 2020-11-03T09:00:00Z}}
 +
{{ServicesApiParam|name=JobArgs|required=Optional for Add, defaults to none|type=String|comment=Free text}}
 +
{{ServicesApiParam|name=RemoteHost|required=Optional for Add, defaults to local GetHostName value|type=String|comment=Remote host's profile name, e.g. from remote's GetHostName}}
 +
 +
Notes: The jobqueue.comment column wil be set to: Dvr/ManageJobQueue.
 +
 +
Example Query:
 +
 +
http://BackendServerIP:6544/Dvr/ManageJobQueue?Action=Add&JobName=UserJob2&RecordedId=12345
 +
 +
Add Returns: -1 for errors or the new JobId
 +
 +
Remove Returns: -1 for errors or the JobId.
 +
==AddDontRecordSchedule==
 +
{{ServicesApiParam|name=ChanId|required=Required|type=Integer|comment=Internal channel ID}}
 +
{{ServicesApiParam|name=StartTime|required=Required|type=DateTime|comment=Program Start Time}}
 +
{{ServicesApiParam|name=NeverRecord|required=Optional|type=Bool|comment=Don't record, ever}}
 +
 +
Returns True or False
  
 
[[Category:Services_API]]
 
[[Category:Services_API]]

Latest revision as of 17:00, 31 August 2023

What is this?

See Services API


Dvr Service API List

API Command Service Version POST Required? Description
GetUpcomingList  ? No Query information on all upcoming programs matching recording rules.
GetExpiringList  ? No Query information on recorded programs which are set to expire.
GetRecordedList  ? No Query information on all recorded programs.
GetRecorded  ? No Query information on a single item from recordings.
AddRecordedCredits 7.0 Yes Add credits to a currently recorded program.
AddRecordedProgram 7.0 Yes Add a recorded program entry into MythTV.
GetConflictList  ? No Query information on upcoming items which will not record due to conflicts.
RemoveRecorded  ? Yes Delete a Recording (deprecated, replaced by DeleteRecording in later versions)
GetEncoderList  ? No Query information on configured capture devices, and their current activity.
RemoveRecordSchedule  ? Yes Remove a Recording rule.
GetRecordScheduleList  ? No Query all configured recording rules, and return them in a list.
GetRecordSchedule  ? No Return a single recording rule, by record id.
AddRecordSchedule  ? Yes Add a single recording rule, by record id.
UpdateRecordSchedule  ? Yes Update a single recording rule, by record id.
EnableRecordSchedule  ? Yes Enable a recording schedule, by record id.
DisableRecordSchedule  ? Yes Disable a recording schedule, by record id.
DeleteRecording 6.0 Yes Delete a recording, by recording id
UnDeleteRecording 6.0 Yes Un-delete a recording, by recording id
UpdateRecordedWatchedStatus 6.0 Yes Mark a recording watched, or unwatched, by recording id
StopRecording 6.3 Yes v32+ Stop a current recording, by recording id
ReactivateRecording 6.3 Yes v32+ Reactivate a stopped recording, by recording id
RescheduleRecordings 6.3 Yes v32+ Trigger a reschedule
RecordedIdForPathname 6.3 No Retrieve the recording id for given a recording file name
GetRecordedMarkup 7.0 No Retrieve the complete markup and seek tables by Recorded Id
SetRecordedMarkup 7.0 Yes Set the markup and seek tables for the given Recorded Id
GetRecordedSeek 6.3 No Retrieve the seektable, by recording id and type
ManageJobQueue 6.6 Yes Administer User, Commflag and Metadata jobs
AddDontRecordSchedule  ? Yes v32+ Don't record a given program, optionally: never record

Dvr APIs

GetUpcomingList

The GetUpcomingList API takes the following arguments:

StartIndex (Optional)
Parameter Type: Integer
The numerical starting index in the list of upcoming programs.
Count (Optional)
Parameter Type: Integer
The number of items to return in the result.
ShowAll (Optional)
Parameter Type: Boolean
Show all items which match recording rules, regardless of whether or not they will record (conflicts, previously recorded, etc.).

Example Query:

http://BackendServerIP:6544/Dvr/GetUpcomingList?StartIndex=2&Count=1&ShowAll=true

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<ProgramList version="1.0" serializerVersion="1.1">
<StartIndex>2</StartIndex>
<Count>1</Count>
<TotalAvailable>15</TotalAvailable>
<AsOf>2011-10-02T16:09:52</AsOf>
<Version>0.25.20110928-1</Version>
<ProtoVer>69</ProtoVer>
<Programs>
    <Program>
        <StartTime>2011-09-12T19:00:00</StartTime>
        <EndTime>2011-09-12T20:01:00</EndTime>
        <Title>Alphas</Title>
        <SubTitle>Blind Spot</SubTitle>
        <Category>Drama</Category>
        <CatType></CatType>
        <Repeat>true</Repeat>
        <SeriesId>EP01410873</SeriesId>
        <ProgramId>EP014108730010</ProgramId>
        <Stars>0</Stars>
        <FileSize>5143875332</FileSize>
        <LastModified>2011-09-12T20:02:18</LastModified>
        <ProgramFlags>13643781</ProgramFlags>
        <HostName>Holmes</HostName>
        <FileName></FileName>
        <Airdate>2011-09-12</Airdate>
        <Inetref>210841</Inetref>
        <Season>1</Season>
        <Episode>9</Episode>
        <Channel>
            <ChanId>34736</ChanId>
            <ChanNum>736</ChanNum>
            <CallSign>SYFYHD</CallSign>
            <IconURL></IconURL>
            <ChannelName>Syfy HD</ChannelName>
            <MplexId>0</MplexId>
            <TransportId>0</TransportId>
            <ServiceId>0</ServiceId>
            <NetworkId>0</NetworkId>
            <ATSCMajorChan>0</ATSCMajorChan>
            <ATSCMinorChan>0</ATSCMinorChan>
            <Format></Format>
            <Modulation></Modulation>
            <Frequency>0</Frequency>
            <FrequencyId></FrequencyId>
            <FrequencyTable></FrequencyTable>
            <FineTune>0</FineTune>
            <SIStandard></SIStandard>
            <ChanFilters></ChanFilters>
            <SourceId>0</SourceId>
            <InputId>0</InputId>
            <CommFree>0</CommFree>
            <UseEIT>false</UseEIT>
            <Visible>false</Visible>
            <XMLTVID></XMLTVID>
            <DefaultAuth></DefaultAuth>
            <Programs/>
        </Channel>
        <Recording>
            <Status>-3</Status>
            <Priority>0</Priority>
            <StartTs>2011-09-12T18:59:00</StartTs>
            <EndTs>2011-09-12T20:02:15</EndTs>
            <RecordId>1126</RecordId>
            <RecGroup>Default</RecGroup>
            <StorageGroup>Default</StorageGroup>
            <PlayGroup>Default</PlayGroup>
            <RecType>0</RecType>
            <DupInType>15</DupInType>
            <DupMethod>6</DupMethod>
            <EncoderId>0</EncoderId>
            <Profile>Default</Profile>https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
        </Recording>
    </Program>
</Programs>
</ProgramList>

See https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.

GetExpiringList

The GetExpiringList API takes the following arguments:

StartIndex (Optional)
Parameter Type: Integer
The numerical starting index in the list of expiring programs.
Count (Optional)
Parameter Type: Integer
The number of items to return in the result.

Example Query:

http://BackendServerIP:6544/Dvr/GetExpiringList?StartIndex=2&Count=1

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<ProgramList version="1.0" serializerVersion="1.1">
<StartIndex>2</StartIndex>
<Count>1</Count>
<TotalAvailable>15</TotalAvailable>
<AsOf>2011-10-02T16:09:52</AsOf>
<Version>0.25.20110928-1</Version>
<ProtoVer>69</ProtoVer>
<Programs>
    <Program>
        <StartTime>2011-09-12T19:00:00</StartTime>
        <EndTime>2011-09-12T20:01:00</EndTime>
        <Title>Alphas</Title>
        <SubTitle>Blind Spot</SubTitle>
        <Category>Drama</Category>
        <CatType></CatType>
        <Repeat>true</Repeat>
        <SeriesId>EP01410873</SeriesId>
        <ProgramId>EP014108730010</ProgramId>
        <Stars>0</Stars>
        <FileSize>5143875332</FileSize>
        <LastModified>2011-09-12T20:02:18</LastModified>
        <ProgramFlags>13643781</ProgramFlags>
        <HostName>Holmes</HostName>
        <FileName></FileName>
        <Airdate>2011-09-12</Airdate>
        <Inetref>210841</Inetref>
        <Season>1</Season>
        <Episode>9</Episode>
        <Channel>https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
            <ChanId>34736</ChanId>
            <ChanNum>736</ChanNum>
            <CallSign>SYFYHD</CallSign>
            <IconURL></IconURL>
            <ChannelName>Syfy HD</ChannelName>
            <MplexId>0</MplexId>
            <TransportId>0</TransportId>
            <ServiceId>0</ServiceId>
            <NetworkId>0</NetworkId>
            <ATSCMajorChan>0</ATSCMajorChan>
            <ATSCMinorChan>0</ATSCMinorChan>
            <Format></Format>
            <Modulation></Modulation>
            <Frequency>0</Frequency>
            <FrequencyId></FrequencyId>
            <FrequencyTable></FrequencyTable>
            <FineTune>0</FineTune>
            <SIStandard></SIStandard>
            <ChanFilters></ChanFilters>
            <SourceId>0</SourceId>
            <InputId>0</InputId>
            <CommFree>0</CommFree>
            <UseEIT>false</UseEIT>
            <Visible>false</Visible>
            <XMLTVID></XMLTVID>
            <DefaultAuth></DefaultAuth>
            <Programs/>
        </Channel>
        <Recording>
            <Status>-3</Status>
            <Priority>0</Priority>
            <StartTs>2011-09-12T18:59:00</StartTs>
            <EndTs>2011-09-12T20:02:15</EndTs>
            <RecordId>1126</RecordId>
            <RecGroup>Default</RecGroup>
            <StorageGroup>Default</StorageGroup>
            <PlayGroup>Default</PlayGroup>
            <RecType>0</RecType>
            <DupInType>15</DupInType>
            <DupMethod>6</DupMethod>
            <EncoderId>0</EncoderId>
            <Profile>Default</Profile>
        </Recording>
    </Program>
</Programs>
</ProgramList>

See https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.

GetRecordedList

The GetRecordedList API takes the following arguments:

StartIndex (Optional)
Parameter Type: Integer
The numerical starting index in the list of expiring programs.
Count (Optional)
Parameter Type: Integer
The number of items to return in the result.
Descending (Optional)
Parameter Type: Boolean
Controls whether results are returned in forward or reverse chronological order.
TitleRegEx (Optional)
Parameter Type: String
Filter the result to recordings with titles matching the regular expression
RecGroup (Optional)
Parameter Type: Boolean
Filter the result to recordings in the matching recording group.
StorageGroup (Optional)
Parameter Type: Boolean
Filter the result to recordings in the matching storage group.

Example Query:

http://BackendServerIP:6544/Dvr/GetRecordedList?StartIndex=2&Count=1&Descending=true

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<ProgramList version="1.0" serializerVersion="1.1">
<StartIndex>2</StartIndex>
<Count>1</Count>
<TotalAvailable>15</TotalAvailable>
<AsOf>2011-10-02T16:09:52</AsOf>
<Version>0.25.20110928-1</Version>
<ProtoVer>69</ProtoVer>
<Programs>
    <Program>
        <StartTime>2011-09-12T19:00:00</StartTime>
        <EndTime>2011-09-12T20:01:00</EndTime>
        <Title>Alphas</Title>
        <SubTitle>Blind Spot</SubTitle>
        <Category>Drama</Category>
        <CatType></CatType>
        <Repeat>true</Repeat>
        <SeriesId>EP01410873</SeriesId>
        <ProgramId>EP014108730010</ProgramId>
        <Stars>0</Stars>
        <FileSize>5143875332</FileSize>
        <LastModified>2011-09-12T20:02:18</LastModified>
        <ProgramFlags>13643781</ProgramFlags>
        <HostName>Holmes</HostName>
        <FileName>1234_2011111111T09:00:00</FileName>
        <Airdate>2011-09-12</Airdate>
        <Inetref>210841</Inetref>
        <Season>1</Season>
        <Episode>9</Episode>
        <Channel>
            <ChanId>34736</ChanId>
            <ChanNum>736</ChanNum>
            <CallSign>SYFYHD</CallSign>
            <IconURL></IconURL>
            <ChannelName>Syfy HD</ChannelName>
            <MplexId>0</MplexId>
            <TransportId>0</TransportId>
            <ServiceId>0</ServiceId>
            <NetworkId>0</NetworkId>
            <ATSCMajorChan>0</ATSCMajorChan>
            <ATSCMinorChan>0</ATSCMinorChan>
            <Format></Format>
            <Modulation></Modulation>
            <Frequency>0</Frequency>
            <FrequencyId></FrequencyId>
            <FrequencyTable></FrequencyTable>
            <FineTune>0</FineTune>
            <SIStandard></SIStandard>
            <ChanFilters></ChanFilters>
            <SourceId>0</SourceId>
            <InputId>0</InputId>
            <CommFree>0</CommFree>
            <UseEIT>false</UseEIT>
            <Visible>false</Visible>
            <XMLTVID></XMLTVID>
            <DefaultAuth></DefaultAuth>
            <Programs/>
        </Channel>
        <Recording>
            <Status>-3</Status>
            <Priority>0</Priority>
            <StartTs>2011-09-12T18:59:00</StartTs>
            <EndTs>2011-09-12T20:02:15</EndTs>
            <RecordId>1126</RecordId>
            <RecGroup>Default</RecGroup>
            <StorageGroup>Default</StorageGroup>
            <PlayGroup>Default</PlayGroup>
            <RecType>0</RecType>
            <DupInType>15</DupInType>
            <DupMethod>6</DupMethod>
            <EncoderId>0</EncoderId>
            <Profile>Default</Profile>
        </Recording>
    </Program>
</Programs>
</ProgramList>

See https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.

Note that the ProgramFlags are listed here: https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37

GetRecorded

The GetRecorded API takes the following arguments:

ChanId (Required)Note that the ProgramFlags are listed here: https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37
Parameter Type: Integer
The database channel id for the guide item.
StartTime (Required)
Parameter Type: String
The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.

From 0.28 or service version 6.0 you may use the recording ID instead of ChanId/StartTime:

RecordedId (Optionally Required)
Parameter Type: Integer
The database recordedid for the recording.

Example Query:

http://BackendServerIP:6544/Dvr/GetRecorded?StartTime=2011-10-03T19:00:00&ChanId=2066

NB It would appear that the StartTime parameter is not the scheduled time of a program but the time the recording actually started; typically a few minutes earlier. This required value is found in <StartTS> as returned by GetRecordedList and not <StartTime>.


Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<Program version="1.1" serializerVersion="1.1">
    <StartTime>2011-10-03T19:00:00</StartTime>
    <EndTime>2011-10-03T20:00:00</EndTime>
    <Title>Little House on the Prairie</Title>
    <SubTitle>Make a Joyful Noise</SubTitle>
    <Category>Drama</Category>
    <CatType>series</CatType>
    <Repeat>true</Repeat>
    <SeriesId>EP00002633</SeriesId>
    <ProgramId>EP000026330155</ProgramId>
    <Stars>0</Stars>
    <FileSize>0</FileSize>
    <LastModified>2011-10-03T19:00:00</LastModified>
    <ProgramFlags>4096</ProgramFlags>
    <HostName></HostName>
    <FileName>1234_2011111111T09:00:00</FileName>
    <Airdate>1981-01-26</Airdate>
     Joe Kagan works up the courage to court Hester Sue, and learns she plans to marry an undertaker (Mel Stewart).
    <Inetref></Inetref>
    <Season>0</Season>
    <Episode>0</Episode>
    <Channel>
        <ChanId>2066</ChanId>
        <ChanNum>185</ChanNum>
        <CallSign>HLMRK</CallSign>
        <IconURL></IconURL>
        <ChannelName>Hallmark Channel (Pacific)</ChannelName>
        <MplexId>0</MplexId>
        <TransportId>0</TransportId>
        <ServiceId>0</ServiceId>
        <NetworkId>0</NetworkId>
        <ATSCMajorChan>0</ATSCMajorChan>
        <ATSCMinorChan>0</ATSCMinorChan>
        <Format></Format>
        <Modulation></Modulation>
        <Frequency>0</Frequency>
        <FrequencyId></FrequencyId>
        <FrequencyTable></FrequencyTable>
        <FineTune>0</FineTune>
        <SIStandard></SIStandard>
        <ChanFilters></ChanFilters>
        <SourceId>0</SourceId>
        <InputId>0</InputId>
        <CommFree>0</CommFree>
        <UseEIT>false</UseEIT>
        <Visible>false</Visible>
        <XMLTVID></XMLTVID>
        <DefaultAuth></DefaultAuth>
        <Programs/>
    </Channel>
    <Recording>
        <Status>0</Status>
        <Priority>0</Priority>
        <StartTs></StartTs>
        <EndTs></EndTs>
        <RecordId>0</RecordId>
        <RecGroup></RecGroup>
        <StorageGroup>Default</StorageGroup>
        <PlayGroup></PlayGroup>
        <RecType>0</RecType>
        <DupInType>1</DupInType>
        <DupMethod>1</DupMethod>
        <EncoderId>0</EncoderId>
        <Profile></Profile>
    </Recording>
</Program>

Note that the ProgramFlags are listed here: https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypeflags.h#L37 See https://www.mythtv.org/wiki/Recording_Status for a discussion on Status.

AddRecordedCredits

The AddRecordedCredits API takes the following arguments:

RecordedId (Required)
Parameter Type: Integer
The Recorded id for the recorded program to add the credits to.
The Post body of the message needs to contain the json list of credits to add in the same format of CastMembers returned by the GetRecording API call

Example Query:

http://BackendServerIP:6544/Dvr/AddRecordedCredits?RecordedId=2066

The query needs Content-Type: application/json when passing a json body

To test using curl:

curl -X POST -H "Content-Type: application/json" "http://rocinante:6744/Dvr/AddRecordedCredits?RecordedId=24"
 -d '
** INSERT POST BODY HERE **
'

Post body:

{
  "CastMembers": [
    {
      "Name": "Alan Davies",
      "CharacterName": "Jonathan Creek",
      "Role": "actor",
      "TranslatedRole": "Actors"
    },
    {
      "Name": "Caroline Quentin",
      "CharacterName": "Maddy Magellan",
      "Role": "actor",
      "TranslatedRole": "Actors"
    },
    {
      "Name": "Julia Sawalha",
      "CharacterName": "Carla Borrego",
      "Role": "actor",
      "TranslatedRole": "Actors"
    },
    {
      "Name": "Stuart Milligan",
      "CharacterName": "Adam Klaus",
      "Role": "actor",
      "TranslatedRole": "Actors"
    }
  ]
}

AddRecordedProgram

The AddRecordedProgram API requires a POST body containing the same json format returned by GetRecording:

{
  "Program": {
    "StartTime": "2021-04-12T04:00:00Z",
    "EndTime": "2021-04-12T05:00:00Z",
    "Title": "The Rookie",
    "SubTitle": "Man of Honor",
    "Category": "Crime drama",
    "CatType": "series",
    "Repeat": "false",
    "VideoProps": "71",
    "VideoPropNames": "WIDESCREEN|HDTV|MPEG2|1080",
    "AudioProps": "8",
    "AudioPropNames": "DOLBY",
    "SubProps": "2",
    "SubPropNames": "NORMAL",
    "SeriesId": "EP02970543",
    "ProgramId": "EP029705430051",
    "Stars": "0",
    "LastModified": "2021-04-12T05:01:16Z",
    "ProgramFlags": "1",
    "ProgramFlagNames": "COMMFLAG",
    "Airdate": "2021-04-11",
    "Description": "Harper and Nolan respond to a bank robbery in progress and realize the motives of the thief run much deeper than just needing money; Jackson and Chen's first day riding without training officers isn't what they though>
    "Inetref": "ttvdb.py_350665",
    "Season": "3",
    "Episode": "10",
    "TotalEpisodes": "0",
    "FileSize": "5446351164",
    "FileName": "11401_20210412030000.ts",
    "HostName": "sapphire",
    "Channel": {
      "ChanId": "11401",
      "ChanNum": "14_1",
      "CallSign": "KTTR-DT",
      "IconURL": "/Guide/GetChannelIcon?ChanId=11401",
      "ChannelName": "KTTR-DT",
      "MplexId": "1",
      "ServiceId": "3",
      "ATSCMajorChan": "14",
      "ATSCMinorChan": "1",
      "Format": "ATSC",
      "FrequencyId": "7",
      "FineTune": "0",
      "ChanFilters": "",
      "SourceId": "1",
      "InputId": "0",
      "CommFree": "false",
      "UseEIT": "true",
      "Visible": "true",
      "ExtendedVisible": "Visible",
      "XMLTVID": "I34215.json.schedulesdirect.org",
      "DefaultAuth": "",
      "ChannelGroups": "",
      "Inputs": "",
      "ServiceType": "0",
      "Programs": []
    },
    "Recording": {
      "RecordedId": "37729",
      "Status": "-3",
      "Priority": "0",
      "StartTs": "2021-04-12T04:00:00Z",
      "EndTs": "2021-04-12T05:01:15Z",
      "FileSize": "5446351164",
      "FileName": "11401_20210412030000.ts",
      "HostName": "empire",
      "LastModified": "2021-04-12T05:01:16Z",
      "RecordId": "8207",
      "RecGroup": "Series",
      "PlayGroup": "Default",
      "StorageGroup": "Default",
      "RecType": "0",
      "DupInType": "15",
      "DupMethod": "6",
      "EncoderId": "0",
      "EncoderName": "quad1",
      "Profile": "Default",
    },
    "Artwork": {
      "ArtworkInfos": [
        {
          "URL": "/Content/GetImageFile?StorageGroup=Coverart&FileName=%2FThe%20Rookie%20Season%203_coverart.jpg",
          "FileName": "myth://Coverart@sapphire/The Rookie Season 3_coverart.jpg",
          "StorageGroup": "Coverart",
          "Type": "coverart"
        },
        {
          "URL": "/Content/GetImageFile?StorageGroup=Fanart&FileName=%2FThe%20Rookie%20Season%203_fanart.jpg",
          "FileName": "myth://Fanart@sapphire/The Rookie Season 3_fanart.jpg",
          "StorageGroup": "Fanart",
          "Type": "fanart"
        }
      ]
    },
    "Cast": {
      "CastMembers": [
        {
          "Name": "Nathan Fillion",
          "CharacterName": "John Nolan",
          "Role": "actor",
          "TranslatedRole": "Actors"
        },
        {
          "Name": "Mekia Cox",
          "CharacterName": "Nyla Harper",
          "Role": "actor",
          "TranslatedRole": "Actors"
        },
          "Name": "Alyssa Diaz",
          "CharacterName": "Angela Lopez",
          "Role": "actor",
          "TranslatedRole": "Actors"
        },
        {
          "Name": "Richard T. Jones",
          "CharacterName": "Sergeant Wade Grey",
          "Role": "actor",
          "TranslatedRole": "Actors"
        },
        {
          "Name": "Titus Makin",
          "CharacterName": "Jackson West",
          "Role": "actor",
          "TranslatedRole": "Actors"
        },
        {
          "Name": "Melissa O'Neil",
          "CharacterName": "Lucy Chen",
          "Role": "actor",
          "TranslatedRole": "Actors"
        }
      ]
    }
  }
}

See https://www.mythtv.org/wiki/Recording_Status for a discussion on recording Status and type.

GetConflictList

The GetConflictList API takes the following arguments:

StartIndex (Optional)
Parameter Type: Integer
The numerical starting index in the list of Conflicting programs.
Count (Optional)
Parameter Type: Integer
The number of items to return in the result.

Example Query:

http://BackendServerIP:6544/Dvr/GetConflictList?StartIndex=0

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<Program version="1.1" serializerVersion="1.1">
    <StartTime>2011-10-03T19:00:00</StartTime>
    <EndTime>2011-10-03T20:00:00</EndTime>
    <Title>Little House on the Prairie</Title>
    <SubTitle>Make a Joyful Noise</SubTitle>
    <Category>Drama</Category>
    <CatType>series</CatType>
    <Repeat>true</Repeat>
    <SeriesId>EP00002633</SeriesId>
    <ProgramId>EP000026330155</ProgramId>
    <Stars>0</Stars>
    <FileSize>0</FileSize>
    <LastModified>2011-10-03T19:00:00</LastModified>
    <ProgramFlags>4096</ProgramFlags>
    <HostName></HostName>
    <FileName></FileName>
    <Airdate>1981-01-26</Airdate>
     Joe Kagan works up the courage to court Hester Sue, and learns she plans to marry an undertaker (Mel Stewart).
    <Inetref></Inetref>
    <Season>0</Season>
    <Episode>0</Episode>
    <Channel>
        <ChanId>2066</ChanId>
        <ChanNum>185</ChanNum>
        <CallSign>HLMRK</CallSign>
        <IconURL></IconURL>
        <ChannelName>Hallmark Channel (Pacific)</ChannelName>
        <MplexId>0</MplexId>
        <TransportId>0</TransportId>
        <ServiceId>0</ServiceId>
        <NetworkId>0</NetworkId>
        <ATSCMajorChan>0</ATSCMajorChan>
        <ATSCMinorChan>0</ATSCMinorChan>
        <Format></Format>
        <Modulation></Modulation>
        <Frequency>0</Frequency>
        <FrequencyId></FrequencyId>
        <FrequencyTable></FrequencyTable>
        <FineTune>0</FineTune>
        <SIStandard></SIStandard>
        <ChanFilters></ChanFilters>
        <SourceId>0</SourceId>
        <InputId>0</InputId>
        <CommFree>0</CommFree>
        <UseEIT>false</UseEIT>
        <Visible>false</Visible>
        <XMLTVID></XMLTVID>
        <DefaultAuth></DefaultAuth>
        <Programs/>
    </Channel>
    <Recording>
        <Status>0</Status>
        <Priority>0</Priority>
        <StartTs></StartTs>
        <EndTs></EndTs>
        <RecordId>0</RecordId>
        <RecGroup></RecGroup>
        <StorageGroup>Default</StorageGroup>
        <PlayGroup></PlayGroup>
        <RecType>0</RecType>
        <DupInType>1</DupInType>
        <DupMethod>1</DupMethod>
        <EncoderId>0</EncoderId>
        <Profile></Profile>
    </Recording>
</Program>

See https://www.mythtv.org/wiki/Recording_Status for a discussion on recording Status and type.

RemoveRecorded

The RemoveRecord API is available in DVR Service versions prior to 2.1. It was renamed in 2.1 to DeleteRecording

See the documentation for DeleteRecording

DeleteRecording

[v2.1+] The DeleteRecording API takes the following arguments:

ChanId (Required)
Parameter Type: Integer
The database channel id for the guide item.
StartTime (Required)
Parameter Type: String
The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.

[v6.0+] From 0.28 you may use the recording ID instead of ChanId/StartTime:

RecordedId (Optionally Required)
Parameter Type: Integer
The database recordedid for the recording.
AllowRerecord (Optional)
Parameter Type: Boolean
Allow the program to be recorded again.
ForceDelete (Optional)
Parameter Type: Boolean
Force deletion of metadata (e.g. if the recording itself doesn't exist.)

Example Query:

http://BackendServerIP:6544/Dvr/DeleteRecording?StartTime=2011-10-03T19:00:00&ChanId=2066 http://BackendServerIP:6544/Dvr/DeleteRecording?RecordedId=1234

UnDeleteRecording

[v6.0+] The UnDeleteRecording API takes the following arguments:

RecordedId (Optionally Required)
Parameter Type: Integer
The database recordedid for the recording.

Example Query:

http://BackendServerIP:6544/Dvr/UnDeleteRecording?StartTime=2011-10-03T19:00:00&ChanId=2066 http://BackendServerIP:6544/Dvr/UnDeleteRecording?RecordedId=1234

StopRecording

[v6.3+] The StopRecording API takes the following arguments:

RecordedId (Required)
Parameter Type: Integer
The database recordedid for the recording.

Example Query:

http://BackendServerIP:6544/Dvr/StopRecording?RecordedId=1234

ReactivateRecording

[v6.3+] The ReactivateRecording API takes the following arguments:

RecordedId (Required)
Parameter Type: Integer
The database recordedid for the recording.

Example Query:

http://BackendServerIP:6544/Dvr/ReactivateRecording?RecordedId=1234

RescheduleRecordings

[v6.3+] The RescheduleRecordings API does not take any arguments.

Example Query:

http://BackendServerIP:6544/Dvr/RescheduleRecordings

UpdateRecordedWatchedStatus

[v6.0+] The UpdateRecordedWatchedStatus API takes the following arguments:

RecordedId (Required)
Parameter Type: Integer
The database recordedid for the recording.
Watched (Required)
Parameter Type: Boolean
Recording watched? True/False

Example Query: http://BackendServerIP:6544/Dvr/UpdateRecordedWatchedStatus?RecordedId=1234&Watched=true

GetEncoderList

The GetEncoderList API takes no arguments.

Example Query:

http://BackendServerIP:6544/Dvr/GetEncoderList

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<EncoderList version="1.0" serializerVersion="1.1">
<Encoders>
    <Encoder>
        <Id>1</Id>
        <HostName>Holmes</HostName>
        <Local>true</Local>
        <Connected>true</Connected>
        <State>0</State>
        <SleepStatus>8</SleepStatus>
        <LowOnFreeSpace>false</LowOnFreeSpace>
        <Recording>
            <StartTime></StartTime>
            <EndTime></EndTime>
            <Title></Title>
            <SubTitle></SubTitle>
            <Category></Category>
            <CatType></CatType>
            <Repeat>false</Repeat>
            <SeriesId></SeriesId>
            <ProgramId></ProgramId>
            <Stars>0</Stars>
            <FileSize>0</FileSize>
            <LastModified></LastModified>
            <ProgramFlags>0</ProgramFlags>
            <HostName></HostName>
            <Airdate></Airdate>
            <Inetref></Inetref>
            <Season>0</Season>
            <Episode>0</Episode>
            <Channel>
                <ChanId>0</ChanId>
                <ChanNum></ChanNum>
                <CallSign></CallSign>
                <IconURL></IconURL>
                <ChannelName></ChannelName>
                <MplexId>0</MplexId>
                <TransportId>0</TransportId>
                <ServiceId>0</ServiceId>
                <NetworkId>0</NetworkId>
                <ATSCMajorChan>0</ATSCMajorChan>
                <ATSCMinorChan>0</ATSCMinorChan>
                <Format></Format>
                <Modulation></Modulation>
                <Frequency>0</Frequency>
                <FrequencyId></FrequencyId>
                <FrequencyTable></FrequencyTable>
                <FineTune>0</FineTune>
                <SIStandard></SIStandard>
                <ChanFilters></ChanFilters>
                <SourceId>0</SourceId>
                <InputId>0</InputId>
                <CommFree>0</CommFree>
                <UseEIT>true</UseEIT>
                <Visible>true</Visible>
                <XMLTVID></XMLTVID>
                <DefaultAuth></DefaultAuth>
                <Programs/>
            </Channel>
            <Recording>
                <Status>0</Status>
                <Priority>0</Priority>
                <StartTs></StartTs>
                <EndTs></EndTs>
                <RecordId>0</RecordId>
                <RecGroup></RecGroup>
                <StorageGroup>Default</StorageGroup>
                <PlayGroup></PlayGroup>
                <RecType>0</RecType>
                <DupInType>1</DupInType>
                <DupMethod>1</DupMethod>
                <EncoderId>0</EncoderId>
                <Profile></Profile>
            </Recording>
        </Recording>
    </Encoder>
</Encoders>
</EncoderList>

See [1] for the possible State values

RemoveRecordSchedule

The RemoveRecordSchedule API takes the following arguments:

RecordId (Required)
Parameter Type: Integer
The database id of the recording rule to be removed.

Example Query:

http://BackendServerIP:6544/Dvr/RemoveRecordSchedule?RecordId=106

Example Return:

Returns a boolean value. True if the file was successfully removed, false if the removal failed for any reason.

<bool>true</bool>

GetRecordScheduleList

The GetRecordScheduleList API takes the following arguments:

StartIndex (Optional)
Parameter Type: Integer
The numerical starting index in the list of recording rules.
Count (Optional)
Parameter Type: Integer
The number of items to return in the result.

Example Query:

http://BackendServerIP:6544/Dvr/GetRecordScheduleList?StartIndex=0&Count=1

Example Return:

<RecRuleList version="1.0" serializerVersion="1.1">
    <StartIndex>0</StartIndex>
    <Count>63</Count>
    <TotalAvailable>63</TotalAvailable>
    <AsOf>2011-11-09T19:22:03</AsOf>
    <Version>0.25.20111102-1</Version>
    <ProtoVer>69</ProtoVer>
    <RecRules>
        <RecRule>
            <Id>1126</Id>
            <ParentId>0</ParentId>
            <Inactive>false</Inactive>
            <Title>Alphas</Title>
            <SubTitle/>
            <Season>1</Season>
            <Episode>1</Episode>
            <Category>Drama</Category>
            <StartTime>2011-11-09T00:00:00</StartTime>
            <EndTime>2011-11-09T00:00:00</EndTime>
            <SeriesId>EP01410873</SeriesId>
            <ProgramId>EP014108730001</ProgramId>
            <Inetref>210841</Inetref>
            <ChanId>3736</ChanId>
            <CallSign>SYFYHD</CallSign>
            <Day>4</Day>
            <Time>22:00:00</Time>
            <FindId>734696</FindId>
            <Type>3</Type>
            <SearchType>0</SearchType>
            <RecPriority>1</RecPriority>
            <PreferredInput>0</PreferredInput>
            <StartOffset>0</StartOffset>
            <EndOffset>0</EndOffset>
            <DupMethod>6</DupMethod>
            <DupIn>15</DupIn>
            <Filter>0</Filter>
            <RecProfile>Default</RecProfile>
            <RecGroup>Default</RecGroup>
            <StorageGroup>Default</StorageGroup>
            <PlayGroup>Default</PlayGroup>
            <AutoExpire>true</AutoExpire>
            <MaxEpisodes>0</MaxEpisodes>
            <MaxNewest>false</MaxNewest>
            <AutoCommflag>true</AutoCommflag>
            <AutoTranscode>false</AutoTranscode>
            <AutoMetaLookup>true</AutoMetaLookup>
            <AutoUserJob1>false</AutoUserJob1>
            <AutoUserJob2>false</AutoUserJob2>
            <AutoUserJob3>false</AutoUserJob3>
            <AutoUserJob4>false</AutoUserJob4>
            <Transcoder>0</Transcoder>
            <NextRecording/>
            <LastRecorded>2011-09-26T18:59:59</LastRecorded>
            <LastDeleted>2011-10-31T17:41:57</LastDeleted>
            <AverageDelay>0</AverageDelay>
        </RecRule>
    </RecRules>
</RecRuleList>

GetRecordSchedule

AddRecordSchedule

UpdateRecordSchedule

The GetRecordSchedule API takes the following arguments:

Old Style

RecordId (Required)
Parameter Type: Integer
The Recording rule ID for the rule to be looked up.

New Style

Returns:	RecRule		
Parameters:
	xs:unsignedInt	RecordId	
	xs:string	Template	
	xs:int	        ChanId	
	xs:dateTime	StartTime	
	xs:boolean	MakeOverride

GetRecordSchedule() provides rules suitable for later calls to AddRecordSchedule() and UpdateRecordSchedule(). When given a valid RecordId, GetRecordSchedule() returns that rule. When given a Template name, GetRecordSchedule() returns an empty rule initialized with that template. When given a ChanId and StartTime, GetRecordSchedule() returns the rule for that program or a new one if no rule currently exists. If the MakeOverride parameter is true, the returned rule for the program will converted to an override rule if needed.

Clients should always call GetRecordSchedule() with the appropriate parameters before modifying the rule and then calling AddRecordSchedule() or UpdateRecordSchedule(). In this way, clients do not need to know all of the details on how to initialize rules or update them for specific programs.

When feeding a new RecRule into AddRecordSchedule() you'll need to set the Station parameter equal to CallSign and modify the Type parameter to something beside "Not Recording"

See this commit: [[2]] for additional information. Also see https://www.mythtv.org/wiki/Recording_Status for a discussion on recording Status and type.

Example Query:

http://BackendServerIP:6544/Dvr/GetRecordSchedule?RecordId=1234

Example Return:

<RecRule version="1.0" serializerVersion="1.1">
    <Id>1126</Id>
    <ParentId>0</ParentId>
    <Inactive>false</Inactive>
    <Title>Alphas</Title>
    <SubTitle/>
    <Season>1</Season>
    <Episode>1</Episode>
    <Category>Drama</Category>
    <StartTime>2011-11-09T00:00:00</StartTime>
    <EndTime>2011-11-09T00:00:00</EndTime>
    <SeriesId>EP01410873</SeriesId>
    <ProgramId>EP014108730001</ProgramId>
    <Inetref>210841</Inetref>
    <ChanId>3736</ChanId>
    <CallSign>SYFYHD</CallSign>
    <Day>4</Day>
    <Time>22:00:00</Time>
    <FindId>734696</FindId>
    <Type>3</Type>
    <SearchType>0</SearchType>
    <RecPriority>1</RecPriority>
    <PreferredInput>0</PreferredInput>
    <StartOffset>0</StartOffset>
    <EndOffset>0</EndOffset>
    <DupMethod>6</DupMethod>
    <DupIn>15</DupIn>
    <Filter>0</Filter>
    <RecProfile>Default</RecProfile>
    <RecGroup>Default</RecGroup>
    <StorageGroup>Default</StorageGroup>
    <PlayGroup>Default</PlayGroup>
    <AutoExpire>true</AutoExpire>
    <MaxEpisodes>0</MaxEpisodes>
    <MaxNewest>false</MaxNewest>
    <AutoCommflag>true</AutoCommflag>
    <AutoTranscode>false</AutoTranscode>
    <AutoMetaLookup>true</AutoMetaLookup>
    <AutoUserJob1>false</AutoUserJob1>
    <AutoUserJob2>false</AutoUserJob2>
    <AutoUserJob3>false</AutoUserJob3>
    <AutoUserJob4>false</AutoUserJob4>
    <Transcoder>0</Transcoder>
    <NextRecording/>
    <LastRecorded>2011-09-26T18:59:59</LastRecorded>
    <LastDeleted>2011-10-31T17:41:57</LastDeleted>
    <AverageDelay>0</AverageDelay>
</RecRule>

EnableRecordSchedule

The EnableRecordSchedule API takes the following arguments:

RecordId (Required)
Parameter Type: Integer
The database id of the recording rule to be enabled.

Example Query:

http://BackendServerIP:6544/Dvr/EnableRecordSchedule?RecordId=106

Example Return:

Returns a boolean value. True if the file was successfully removed, false if the removal failed for any reason.

<bool>true</bool>

DisableRecordSchedule

The DisableRecordSchedule API takes the following arguments:

RecordId (Required)
Parameter Type: Integer
The database id of the recording rule to be removed.

Example Query:

http://BackendServerIP:6544/Dvr/DisableRecordSchedule?RecordId=106

Example Return:

Returns a boolean value. True if the file was successfully removed, false if the removal failed for any reason.

<bool>true</bool>

RecordedIdForPathname

The RecordedIdForPathname API takes the following arguments:

Pathname (Required)
Parameter Type: String
basename, or full path of a recorded file.

Example Query:

http://BackendServerIP:6544/Dvr/RecordedIdForPathname?Pathname=1050_20160912221500.ts

Returns an integer, representing the RecordedId.

<int>1234</int>

GetRecordedMarkup

The GetRecordedMarkup API takes the following arguments:

RecordedId (Required)
Parameter Type: Integer
The database Recorded Id for the recording.

The result is a complete dump of the mythconverg.recordedseek and mythconverg.recordedmarkup tables:

http://BackendServerIP:6544/Dvr/GetRecordedMarkup?RecordedId=539

{
        "MarkupList": {
          "Mark": [
            {
              "Type": "UPDATED_CUT",
              "Frame": "0",
              "Data": "NULL"
            },
            {
              "Type": "DURATION_MS",
              "Frame": "0",
              "Data": "3675000"
            },
            {
              "Type": "TOTAL_FRAMES",
              "Frame": "0",
              "Data": "93271"
            },
            {
              "Type": "ASPECT_16_9",
              "Frame": "1",
              "Data": "NULL"
            },
            {
              "Type": "VIDEO_WIDTH",
              "Frame": "1",
              "Data": "1920"
            },
            {
              "Type": "VIDEO_HEIGHT",
              "Frame": "1",
              "Data": "1080"
            },
            {
              "Type": "VIDEO_RATE",
              "Frame": "1",
              "Data": "29970"
            },
            {
              "Type": "UTIL_PROGSTART",
              "Frame": "736",
              "Data": "NULL"
            },
            {
              "Type": "COMM_START",
              "Frame": "18996",
              "Data": "NULL"
            },
            {
              "Type": "COMM_END",
              "Frame": "23385",
              "Data": "NULL"
            },
              "Type": "COMM_START",
              "Frame": "50981",
              "Data": "NULL"
            },
            {
              "Type": "COMM_END",
              "Frame": "57557",
              "Data": "NULL"
            },
            {
              "Type": "COMM_START",
              "Frame": "89741",
              "Data": "NULL"
            },
            {
              "Type": "COMM_END",
              "Frame": "93539",
              "Data": "NULL"
            }
          ],
          "Seek": [
            {
              "Type": "GOP_BYFRAME",
              "Frame": "0",
              "Data": "376"
            },
            {
              "Type": "DURATION_MS",
              "Frame": "0",
              "Data": "0"
            },
            {
              "Type": "GOP_BYFRAME",
              "Frame": "45",
              "Data": "2202608"
            },
            {
              "Type": "DURATION_MS",
              "Frame": "45",
              "Data": "1502"
            },
            {
              "Type": "GOP_BYFRAME",
              "Frame": "90",
              "Data": "4544148"
            },

Results truncated.

SetRecordedMarkup

The SetRecordedMarkup API takes the following arguments:

RecordedId (Required)
Parameter Type: Integer
The database recordedid for the recording.

Example:

http://BackendServerIP:6544/Dvr/GetRecordedMarkup?RecordedId=539

The body of the POST message must be in the same json format as returned by the GetRecordedMarkup API call. See above for example.

GetRecordedSeek

The GetRecordedSeek API takes the following arguments:

RecordedId (Required)
Parameter Type: Integer
The database recordedid for the recording.
OffsetType (Required)
Parameter Type: String
Either 'BYTES' or 'DURATION'

Example Query:

http://BackendServerIP:6544/Dvr/GetRecordedSeek?RecordedId=449&OffsetType=BYTES

Returns: A 'cut' mapping. The element names could be more descriptive, but match the format of the GetRecordedCutList and GetRecordedCommBreak API calls to allow code re-use.

<CutList version="1.0" serializerVersion="1.1">
    <Cuttings>
        <Cutting>
            <Mark>0</Mark>
            <Offset>0</Offset>
        </Cutting>
        <Cutting>
            <Mark>1</Mark>
            <Offset>1227264</Offset>
        </Cutting>
        <Cutting>
            <Mark>2</Mark>
            <Offset>2454528</Offset>
        </Cutting>
    </Cuttings>
</CutList>

Or

<CutList version="1.0" serializerVersion="1.1">
    <Cuttings>
        <Cutting>
            <Mark>0</Mark>
            <Offset>0</Offset>
        </Cutting>
        <Cutting>
            <Mark>1</Mark>
            <Offset>500</Offset>
        </Cutting>
        <Cutting>
            <Mark>2</Mark>
            <Offset>1000</Offset>
        </Cutting>
    </Cuttings>
</CutList>

ManageJobQueue

    Action (Required)
        Parameter Type: String
        Either Add or Remove.


    JobName (Required)
        Parameter Type: String
        UserJob<1-4>, Commflag, Metadata.


    JobId (Required for Remove)
        Parameter Type: Integer
        Job Queue ID.


    RecordedId (Required)
        Parameter Type: Integer
        Id of the recording to act on.


    JobStartTime (Optional for Add, defaults to current time)
        Parameter Type: Time Stamp
        Full timestame, e.g. 2020-11-03T09:00:00Z.


    JobArgs (Optional for Add, defaults to none)
        Parameter Type: String
        Free text.


    RemoteHost (Optional for Add, defaults to local GetHostName value)
        Parameter Type: String
        Remote host's profile name, e.g. from remote's GetHostName.


Notes: The jobqueue.comment column wil be set to: Dvr/ManageJobQueue.

Example Query:

http://BackendServerIP:6544/Dvr/ManageJobQueue?Action=Add&JobName=UserJob2&RecordedId=12345

Add Returns: -1 for errors or the new JobId

Remove Returns: -1 for errors or the JobId.

AddDontRecordSchedule

    ChanId (Required)
        Parameter Type: Integer
        Internal channel ID.


    StartTime (Required)
        Parameter Type: DateTime
        Program Start Time.


    NeverRecord (Optional)
        Parameter Type: Bool
        Don't record, ever.


Returns True or False