[mythtv-users] Help needed for scripted recordings

Klaas de Waal klaas.de.waal at gmail.com
Sun Mar 29 14:34:05 UTC 2020


On Sat, 28 Mar 2020 at 20:41, Bill Meek <keemllib at gmail.com> wrote:

> On 3/28/20 2:27 PM, Klaas de Waal wrote:
> >    File "./mythtv-record.py", line 1479, in delete_recordingid
> >      resp_dict = backend.send(endpoint=endpoint, rest=rest, opts=opts)
>
> Need to use postdata rather than rest, for example:
>
>      postdata = {
>          'RecordedId': recordedid,
>          'ForceDelete': 'True',
>          'AllowRerecord': 'True'
>      }
>
>      resp_dict = backend.send(endpoint=endpoint, postdata=postdata,
> opts=opts)
>
>
> Yes this does work and it can actually delete a recording in progress.
Problem is that it requires a recordedid but when I start the recording I
get a recordid.
As shown by the following:

[klaas at modu MythTVPython]$ ./mythtv-record.py add --chanid 170858 --manual
--starttime 2020-03-29T16:15:00 --type Single --title test2 --duration=60
-1: 170858 NPO 1 Single Record test2 Start:2020-03-29T14:15:00Z
 End:2020-03-29T15:15:00Z  Priority:0      Inactive:false  Profile:Default
RecGroup:Default PlayGroup:Default LastRecorded:      Expire:true

Added: "test2" (RecordId 3796).

MariaDB [mythconverg]> select chanid,title,recordid,recordedid from
recorded where recordid=3796;
+--------+-------+----------+------------+
| chanid | title | recordid | recordedid |
+--------+-------+----------+------------+
| 120081 | test2 |     3796 |       8896 |
+--------+-------+----------+------------+

[klaas at modu MythTVPython]$ ./mythtv-record.py delete --recordid 8896
RecordingId "8896" has been deleted.

My understanding is that the entry in table record is created when the
recording is scheduled with the "mythtv-record.py add" command. This makes
it possible to return the recordid.
The entry in table recorded is created when the recording is started, which
is usually later in time, so the "myth-record.py add" command cannot know
this.
So it looks that what I need is the incantation to delete a recording by
recordid.
Or a sql query to get the recordedid but that is not really how the
ServicesAPI should work afaik.

Thanks,
Klaas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20200329/5618eb5e/attachment.htm>


More information about the mythtv-users mailing list