API Request: expose overall total DVR engine space

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
djp952
Posts: 959
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

API Request: expose overall total DVR engine space

Post by djp952 » Fri Jun 28, 2019 9:27 pm

An end user has requested that I implement a Kodi PVR function that requires me to know both the total and used space on the backend(s). Currently, the HDHomeRun DVR engine only reports the "FreeSpace" of the DVR engine. It would be very beneficial if the discovery data provided by an HDHomeRun DVR engine reported both the total space available to it as well as the free space as opposed to just the free space by itself. If I have at least two parameters I can easily solve the required equation, but I'm pretty much dead in the water having just the one parameter.

Thank you for any consideration given to this request.

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

Re: API Request: expose overall total DVR engine space

Post by nickk » Sat Jun 29, 2019 8:22 am

Agreed... I will make it happen for the next release.

For working with total/free space values the recommended approach is to do all mathematics in Bytes using uint64 types, then convert the final number(s) to be displayed into GB with the following equation:

GB = (B + 500,000,000) INTDIV 1,000,000,000

That will ensure the correct rounding, correct scaling, and result in consistent numbers between applications.

Nick

Ken.F
Posts: 2152
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: API Request: expose overall total DVR engine space

Post by Ken.F » Sat Jun 29, 2019 9:46 am

Would it be possible to exclude the storage space from engines with RecordStreamsMax=0 in hdhomerun.conf? I wouldn't want the free space on my storage only device to be reported available for recordings.

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

Re: API Request: expose overall total DVR engine space

Post by nickk » Sat Jun 29, 2019 10:42 am

Ken.F wrote:
Sat Jun 29, 2019 9:46 am
Would it be possible to exclude the storage space from engines with RecordStreamsMax=0 in hdhomerun.conf? I wouldn't want the free space on my storage only device to be reported available for recordings.
The FreeSpace isn't included if RecordStreamsMax is 0 (as of the 20190621 release). The future TotalSpace will work the same way.

Nick

Ken.F
Posts: 2152
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: API Request: expose overall total DVR engine space

Post by Ken.F » Sat Jun 29, 2019 10:52 am

Thanks.

Post Reply