Delete Recording with 20190516beta2

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
Post Reply
demonrik
Posts: 1116
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Delete Recording with 20190516beta2

Post by demonrik » Sat May 18, 2019 4:19 pm

trying to delete a recording using the documented API (https://github.com/Silicondust/document ... Recordings) which has worked up until the recent DVR engine beta 20190516beta2

Am trying to delete the following recording on one of my NASes

Code: Select all

"Category":"sport","ChannelAffiliate":"ABC","ChannelImageURL":"http://img.hdhomerun.com/channels/US21210.png","ChannelName":"KNXVDT","ChannelNumber":"15.1","EndTime":1558213200,"EpisodeNumber":"S05E60","EpisodeTitle":"The Monster Energy Big Wave Invitational","FirstAiring":1,"ImageURL":"http://img.hdhomerun.com/titles/C10427168EN0BTT.jpg","OriginalAirdate":1558137600,"ProgramID":"EP018470050307","RecordEndTime":1558213230,"RecordError":"0x0008: Partial recording","RecordStartTime":1558209570,"SeriesID":"C10427168EN0BTT","StartTime":1558209600,"Synopsis":"An all-star cast of the best big wave riders in the world tackle a giant swell on the fabled North Shore of Hawaii, pushing the limits of performance by towing-in to the monster-sized surf.","Title":"World of X Games","DisplayGroupID":"sport","DisplayGroupTitle":"Sporting Events","PlayURL":"http://192.168.0.21:59090/recorded/play?id=b000402b","CmdURL":"http://192.168.0.21:59090/recorded/cmd?id=b000402b"}
Using the CmdURL I add the command to delete and set rerecord to 0 or 1, i.e.

Code: Select all

http://192.168.0.21:59090/recorded/cmd?id=b000402b&cmd=delete&rerecord=1
All I get back from the engine is 400 Bad Request error.

I can delete the recording via the beta UI of the HDHomeRun View - while the non-beta UI cannot delete either

Am guessing the command has changed due to the multi-engine capability?

jasonl
Silicondust
Posts: 14044
Joined: Sun Oct 28, 2007 9:23 pm

Re: Delete Recording with 20190516beta2

Post by jasonl » Sat May 18, 2019 5:09 pm

Going forward, any requests to delete a recording or poke the DVR have to be an HTTP POST, not a GET.

signcarver
Expert
Posts: 8239
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 131B34B7 13231F92 1070A18E 1073ED6F

Re: Delete Recording with 20190516beta2

Post by signcarver » Sat May 18, 2019 5:21 pm

Thanks jasonl, you beat me to it... I set up an engine on a windows machine that I had wireshark running, put some content there, and saw the difference after testing deleting both ways... seems strange the other requests are still gets.

demonrik
Posts: 1116
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Delete Recording with 20190516beta2

Post by demonrik » Sat May 18, 2019 9:07 pm

jasonl wrote:
Sat May 18, 2019 5:09 pm
Going forward, any requests to delete a recording or poke the DVR have to be an HTTP POST, not a GET.
makes sense.
will make the appropriate changes :)

demonrik
Posts: 1116
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Delete Recording with 20190516beta2

Post by demonrik » Sun May 19, 2019 2:51 pm

So literally I just change from GET to POST..
but all the params are in the URL and not in the content.
Wasn't expecting that!

Working through the updates now for the DVR Managers.

djp952
Posts: 897
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Delete Recording with 20190516beta2

Post by djp952 » Sun May 19, 2019 8:44 pm

jasonl wrote:
Sat May 18, 2019 5:09 pm
Going forward, any requests to delete a recording or poke the DVR have to be an HTTP POST, not a GET.
Hi Jason, do all versions of the DVR support HTTP POST for these two operations, or was there a cutover at some point in the past where POST became valid? I ask because I need to know if I can unilaterally switch over to POST or if I have to start checking the DVR version first.

nickk
Silicondust
Posts: 15524
Joined: Tue Jan 13, 2004 9:39 am

Re: Delete Recording with 20190516beta2

Post by nickk » Mon May 20, 2019 10:14 am

All DVR versions support POST.

Older versions accept GET or POST.
Newer versions only accept POST.

Nick

gtb
Expert
Posts: 3985
Joined: Thu Oct 06, 2011 1:00 pm
Location: Sunnyvale, CA USA

Re: Delete Recording with 20190516beta2

Post by gtb » Mon May 20, 2019 10:28 am

nickk wrote:
Mon May 20, 2019 10:14 am
Newer versions only accept POST.
A reasonable choice moving forward. Web standards (not always fully enforced) suggest that anything that changes the state should be a POST. Certainly deleting a recording should be considered a change of server state.

djp952
Posts: 897
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Delete Recording with 20190516beta2

Post by djp952 » Mon May 20, 2019 7:50 pm

Note to OP: I also found that setting a recording's last played position with ?cmd=set&Resume=N requires the HTTP POST method now as well, which makes sense.

SiliconDust, will the backend Recording Rule API also be modified at some point to require POST when manipulating rules? I found that the tuners accept POST when manipulating channel visibility (lineup.post), so I am also switching that operation over.

Many thanks to you all.

sixer
Posts: 32
Joined: Thu Jun 16, 2016 6:46 pm

Re: Delete Recording with 20190516beta2

Post by sixer » Wed Jun 19, 2019 8:46 pm

Thanks to @demonrik for updating his AWESOME web DVR UI.

0.7.0 is not "released" yet, but if you grab the latest master, he's updated the php/js to POST and it works!

https://github.com/demonrik/HDHR-DVRUI

Nick

Post Reply