Get list of pending recordings?

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
cncb
Posts: 58
Joined: Mon Jul 13, 2009 7:56 pm

Get list of pending recordings?

Post by cncb » Thu Oct 31, 2019 4:00 pm

From reading other threads, it looks like there is an URL for the json of the completed recordings list. I may be missing something obvious, but I don't see any mention of this in the API documentation. Is there even more to the API that is not documented such as getting a list of the pending recordings? What about guide data? Is there somewhere that documents all that is available? Thanks.

bdbauer
Posts: 89
Joined: Mon Jul 09, 2018 10:07 am

Re: Get list of pending recordings?

Post by bdbauer » Sat Nov 02, 2019 2:53 pm

There is some documentation and pointers to other documentation here: https://github.com/snemetz/synology/blo ... oc-APIs.md

Getting the completed recordings is a call to your recording device. but you'll need to know the IP address and port of that device.
http://x.x.x.x.pppp/recorded_files.json

Getting the up coming recordings requires a few steps.
1. Get the authentication string from your HDHR device: http://x.x.x.x/discover.json
2. Get the series IDs from the API: https://api.hdhomerun.com/api/recording ... xxxxxxxxxx (xxx.. is auth string)
3. For each series, list the episodes: https://api.hdhomerun.com/api/episodes?ssssss (sss.. is the series ID)

It's a bit different if you're looking for upcoming movies and sports.

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

Re: Get list of pending recordings?

Post by djp952 » Mon Nov 04, 2019 9:00 pm

Just to add a little to bdbauer's response ...

The JSON that comes back from the /api/episodes query will list all episodes that are upcoming for that series. You will need to look for "RecordingRule:1" in the data to know if the episode might be recorded. I say might intentionally -- AFAIK there is no way to be certain that the DVR engine will actually record this episode, it depends on information we don't seem to have access to. For example, if the episode has already been recorded, the JSON may still say "RecordingRule:1", but the won't actually be recorded.

The data is notably better filtered than it once was, I see a much smaller list of episodes with "RecordingRule:1" than I used to, which is great, but I think you will still want to make a couple educated decisions once you see the JSON and the flag(s) it indicates.

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

Re: Get list of pending recordings?

Post by jasonl » Tue Nov 05, 2019 11:33 am

The episodes API was updated recently to include RecordingRuleExt which will give more information. RecordDuplicate means the airing will record no matter what because it's flagged as new or is a one-off recording (red dot in the HDHomeRun app). RecordIfNotRecorded means the episode will record if it's not on the DVR at the time of recording (red dot if not on DVR and no earlier airing, gray dot if not on DVR and there is an earlier airing, green check if is on the DVR). DeletedDontRerecord is self-explanatory (gray check).

cncb
Posts: 58
Joined: Mon Jul 13, 2009 7:56 pm

Re: Get list of pending recordings?

Post by cncb » Wed Nov 06, 2019 7:30 am

Thanks, all, for the help. Another question: Does the API give read/write access to the current playback (resume) position for each episode?

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

Re: Get list of pending recordings?

Post by jasonl » Wed Nov 06, 2019 5:26 pm

Resume position is in the recorded_files json, as "Resume", in seconds. Setting uses the cmdurl with &cmd=set&Resume=xxxx where xxxx is the position.

Post Reply