Can the Add a DateTimeOnly rule API be used without a Series ID?

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
titantractor271
Posts: 46
Joined: Mon Jan 18, 2021 9:27 am

Can the Add a DateTimeOnly rule API be used without a Series ID?

Post by titantractor271 »

I am testing the "Add a DateTimeOnly-ChannelOnly recording rule" API. I used Postman to build my API string and send this. I received a null from my response. I used the DateTimeOnly value of 1611540000 for this coming Sunday 1/24 at 9:00pm and I chose a channel, then used 30 seconds for the other values. Cmd="add". What would I use for the SeriesID if I don't have a guide entry?

Note: Has anyone setup the Postman scripts for all of the API?

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

Re: Can the Add a DateTimeOnly rule API be used without a Series ID?

Post by djp952 »

The SeriesID is currently required by the API but I think they said they have been looking into adding support for a simple date/time/channel rule to be added in the future.

Insofar as I know there is no way to get the SeriesID for a program at a specific date and time / channel :(

titantractor271
Posts: 46
Joined: Mon Jan 18, 2021 9:27 am

Re: Can the Add a DateTimeOnly rule API be used without a Series ID?

Post by titantractor271 »

djp952 wrote: Tue Jan 19, 2021 6:48 pm The SeriesID is currently required by the API but I think they said they have been looking into adding support for a simple date/time/channel rule to be added in the future.

Insofar as I know there is no way to get the SeriesID for a program at a specific date and time / channel :(
Thank you. Saves me the pain... I assume this SeriesID is not an industry standard ID, but an ID within the SD XMLTV guide? I'll practice the APIs and learn what I can do with my Homerun.

Note: I am new to the forum, so my replies may be limited:)

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

Re: Can the Add a DateTimeOnly rule API be used without a Series ID?

Post by djp952 »

It's generally standard and is sourced from Gracenote insofar as I am aware. In my code, I check for the XMLTV element typically being additionally qualified with "system='cseries'" but I also add a fallback to whatever the first "series-id" attribute I found should be applied (C++/libxml2 code here):

Code: Select all

		// Special case: the series-id tag will typically be qualified with system=cseries, but some items like Movies (programtype MV) will
		// not be qualified with that attribute.  Try system=cseries first, then use any series-id node
		case xmltv_vtab_columns::seriesid:
			node = xmlTextReaderGetChildElementWithAttribute(xmltvcursor->reader, BAD_CAST("series-id"), BAD_CAST("system"), BAD_CAST("cseries"));
			if(node == nullptr) node = xmlTextReaderGetChildElement(xmltvcursor->reader, BAD_CAST("series-id"));
			if(node != nullptr) sqlite3_result_text(context, reinterpret_cast<char*>(xmlNodeGetContent(node)), -1, xmlFree);
			break;

titantractor271
Posts: 46
Joined: Mon Jan 18, 2021 9:27 am

Re: Can the Add a DateTimeOnly rule API be used without a Series ID?

Post by titantractor271 »

djp952 wrote: Tue Jan 19, 2021 9:23 pm It's generally standard and is sourced from Gracenote insofar as I am aware.
Thanks. So to prove that out, I'd need to look at other guides/tools to compare the series id. So the root of my question is to figure a way to make manual entries. If I do come up with a series ID without that being in the SD guide, would creating a recording rule work? I guess I am looking to understand how to implement that API to see if it will do what I'm trying. I found the key show I needed, but going forward, I expect to hit this again.

signcarver
Expert
Posts: 9538
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 30

Re: Can the Add a DateTimeOnly rule API be used without a Series ID?

Post by signcarver »

SD's API works BY SERIES... nothing you can do about that (until such changes).

Currently what you really want to do is make a manual recording yourself (outside of the DVR) and add the appropriate header/metadata information at the start of the file (formatted as a ts) if you wish for it to be available in apps that expect such and to be served by the DVR engine.

An alternative way would be to look up what is scheduled then and adjust padding appropriately however this doesn't always work as the DVR checks in every hour or two to get updates which might change. For example when ABC had Black Panther on as a result of Chadwick Boseman's death... that wasn't in the guide that morning so I had to schedule what was scheduled at that time. In the middle of the movie the guide updated for many so their scheduled show was no more. For me I ended up with two files as I also was able to schedule the real movie from a different network so when it got its updates it started to record it for the "series" rule. For some at that time it stopped writing the file (but continued to tie up tuner) so such updates can be a real mess (though probably 95% of the time it would go unnoticed).

titantractor271
Posts: 46
Joined: Mon Jan 18, 2021 9:27 am

Re: Can the Add a DateTimeOnly rule API be used without a Series ID?

Post by titantractor271 »

signcarver wrote: Wed Jan 20, 2021 8:18 am SD's API works BY SERIES... nothing you can do about that (until such changes).
Appreciate the level set here! I don't quite understand the API yet, I'll have to practice these knowing I need the series ID.
signcarver wrote: Wed Jan 20, 2021 8:18 am Currently what you really want to do is make a manual recording yourself (outside of the DVR) and add the appropriate header/metadata information at the start of the file (formatted as a ts) if you wish for it to be available in apps that expect such and to be served by the DVR engine.
When you say outside of the DVR, I presume I need to pull a stream from the tuners by some other CPU and then record to a disk with the ts format and header/meta data.

Also when you say outside of the DVR, I am curious what is inside the DVR. Is that an automatic processor which then sends to disk? Also is that the same software or API distributed for building your own NAS DVR?

Note: (edit since posting this) I found some python code which seems to use the homerun tuner to record the stream to disk. I am going to experiment with that, but I presume I can't get those recordings into my SD DVR because that seems to be tied to the guide/Series-id/task list. Is this correct?

Post Reply