HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Help and support with third-party TV software.
Windows Media Center, J River Media Center, Next PVR, MythTV, InstaTV, etc.
Post Reply
demonrik
Posts: 1104
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by demonrik » Thu Jan 10, 2019 7:46 pm

airdrummer wrote:
Thu Jan 10, 2019 9:50 am
just found this & installed on my server, many thanx, demonrik, looks great!-) i'm looking into branching it for my needs, as clicking on play tries to d/l stream to local browser, but i want it to open in vlc on my dvr connected to my hdtv...

so i started inspecting the html, & saw how you do rerecord:

Code: Select all

<a onclick="RecordingDeleteReveal(event,'74247630',false);" class="delete">Delete</a>
<a onclick="RecordingDeleteReveal(event,'74247630',true);" class="rerecord">ReRecord</a>
which is passed to the engine via a hidden field in the form:

Code: Select all

<input id="drerecord" name="rerecord" value="true" type="hidden">
which is poked in ur RecordingDeleteReveal.js:

Code: Select all

document.getElementById("drerecord").value = rerecord;
but as u r reusing the delete form, the form & button say delete

Code: Select all

<a onclick="submitDeleteRecording()">Delete</a>
which is rather offputting, not to mention confusing;-}

the play/delete/rerecord buttons shouldn't be repeated in the delete/rerecord dialogs (which is confusing) and the rerecord dialog & button really should be labeled rerecord, nicht wahr?-) i've modded scripts/hdhomerundvr_ui.js and style/recordingdeletereveal.html to fix this, but i never grokked git, so lemme know if u want to see my mods...
the reason is that rerecord and delete are ultimately the same.. thus the only place we make the difference visible is in the presentation layer.. where we pass the false|true flag to indicate whether to add the rerecord flag to the delete phase.

So... the changes you mention all just depend on your philosophy of how fast to move from user experience to the hardware nuances. I wanted to keep the php interface as close to the hardware as possible and then propogate that through to the html/js doing a delete in both cases but pretending to the user it's doing something different.

To get player to work you will probably have to do mime types, etc..
I didn't bother really working that aspect because I didn't need it. Would be interested to take in those changes when you get them done. If you PM me your github repo I can track and pull into the baseline at some point (real way to do it is a pull request).

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by airdrummer » Thu Jan 10, 2019 8:04 pm

right, i've added

Code: Select all

    document.getElementById("drrLabel").innerHTML
             = (rerecord
                 ? "Delete&Rerecord"
                 : "Delete");
    document.getElementById("drrTitle").innerHTML
             = (rerecord
                 ? "Rerecord"
                 : "Delete Recording");
to RecordingDeleteReveal() in hdhomerundvr_ui.js so it's perfectly clear what's going on...once i figure out git, i'll do the pull request.

i've also hacked the play link to send the url to the vlc running on my minimac hooked up to the hdtv, rather than opening it on the local browser, dunno if u r interested in that...it's a steaming pile'o applescript/cgi/kludge that i wrote nearly 10 yrs ago;-) here's the only bit of applescript i had to add:

Code: Select all

property hdhrURL : "http://10.0.1.224:34597"
property ClientID : "70a2fdd80a2b4d5e" -- UUID/2 8d672e5a8b9598ef
property SessionID : 0 -- this is incremented & persisted
property openVLC : "open -a VLC.app \""
...
        set cv to eti(cmd, "=")
        set cmd to contents of (item 1 of cv)
        
        if cmd = "hdhr" then
            set chName to contents of (item 2 of cv) as string
            if chName starts with hdhrURL then
                set recID to contents of (item 3 of cv) as string
                set recURL to chName & "=" & recID -- url contains hdhrURL&id=recID
                set recTitle to contents of (item 4 of cv) as string
                set epTitle to contents of (item 5 of cv) as string
                if epTitle starts with "No Episode Title Available" then ¬
                    set epTitle to ""
                set rtn to ("watching hdhr " & recTitle & " " & epTitle & " on VLC " & recURL) as string
                set ss to (openVLC & recURL & "\"") as string
            else
                set chNum to contents of (item 3 of cv) as integer -- throws error on bad int
                set SessionID to SessionID + 1
                set rtn to "?ClientID=" & ClientID & "&SessionID=" & SessionID
                set ss to (openVLC & hdhrURL & "/auto/v" & chNum & rtn & "\"") as string
                set rtn to ("watching fios " & chNum & ":" & chName & " on VLC " & rtn) as string
            end if
            tell application "VLC" to stop
            do shell script ss
            tell application "playRec" to setPlaying(my rtn, "VLC")
            return rtn
dunno why code lost the indents:-\
Last edited by airdrummer on Thu Jan 10, 2019 8:45 pm, edited 1 time in total.

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

question on rules

Post by airdrummer » Thu Jan 10, 2019 8:11 pm

i can see & delete/change priority on my rules, but how do i get to the advanced rules?

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

re: advanced rules

Post by airdrummer » Thu Jan 10, 2019 8:39 pm

demonrik wrote:
Tue Sep 11, 2018 10:27 pm
Advanced Rule
Image
And finally one last feature worth speaking of.. In addition to the same rules you can do withe the View Application, the HDHR-DVRUI has an option to setup more complex rules through our Advanced Rules tool.
Here you can:
  • Limit the recordings to a single channel
  • record only at a specific time
  • record only if the episode is first time airing
  • Adjust the padding for the rule
great googlymoogly u buried that in peat;-) i had to grep "advanced rule" to find that it's in style/series_actions.html, then grep style/series_actions.html to find that it's in search.php

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

Re: re: advanced rules

Post by demonrik » Thu Jan 10, 2019 10:10 pm

airdrummer wrote:
Thu Jan 10, 2019 8:39 pm
demonrik wrote:
Tue Sep 11, 2018 10:27 pm
Advanced Rule
Image
And finally one last feature worth speaking of.. In addition to the same rules you can do withe the View Application, the HDHR-DVRUI has an option to setup more complex rules through our Advanced Rules tool.
Here you can:
  • Limit the recordings to a single channel
  • record only at a specific time
  • record only if the episode is first time airing
  • Adjust the padding for the rule
great googlymoogly u buried that in peat;-) i had to grep "advanced rule" to find that it's in style/series_actions.html, then grep style/series_actions.html to find that it's in search.php
structure is pretty straight forward..
All the presentation - the view - is in the style.. These provide the templates for displaying
The Control is in the php files in the root - representing the major funcitons of each tab
The model is built from the includes

So.. the advanced rule is in search because that's the only place it's used.. we don't support editing the rules in the rules tab. (see earlier explanation as to why from @signcarver)

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

re: advanced rules

Post by airdrummer » Fri Jan 11, 2019 6:54 am

the advanced rule is in search because that's the only place it's used.. we don't support editing the rules in the rules tab. (see earlier explanation as to why from @signcarver)
ok, sure, but it's certainly hard to find...and i c u use the american naming convention* for the recordtype radio buttons:

Code: Select all

	var radios = document.getElementsByName('recordtype');
* cell vs mobile/implementation vs function...but i digress;-)

now to dig up signcarver...

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by airdrummer » Fri Jan 11, 2019 7:56 am

Bigj wrote:
Mon Dec 10, 2018 7:22 pm
demonrik wrote:
Mon Dec 10, 2018 6:50 pm
pops up when you select show to record on searching
Thank you. I was going crazy trying to find that on all my existing rules. You need to click on the three dots "..." next to the "Record Recent Record All ..." in the search.
rilly;-) i've renamed the search page "Search Program Guide" so wife can grok wtf u r searching for...she might want to search recordings, eh?-}

and instead of trying to cram everything into those little boxes, where u can't actually read search_Synopsis or see the record links (or even know they're links) clicking on a box should display the program info by itself...i'm working on that;-)

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

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by demonrik » Fri Jan 11, 2019 11:07 am

airdrummer wrote:
Fri Jan 11, 2019 7:56 am
Bigj wrote:
Mon Dec 10, 2018 7:22 pm
demonrik wrote:
Mon Dec 10, 2018 6:50 pm
pops up when you select show to record on searching
Thank you. I was going crazy trying to find that on all my existing rules. You need to click on the three dots "..." next to the "Record Recent Record All ..." in the search.
rilly;-) i've renamed the search page "Search Program Guide" so wife can grok wtf u r searching for...she might want to search recordings, eh?-}

and instead of trying to cram everything into those little boxes, where u can't actually read search_Synopsis or see the record links (or even know they're links) clicking on a box should display the program info by itself...i'm working on that;-)
I don't let my wife near this app - she would kill me if I forced her to use it :)

FWIW - if you have things that fix issues, like naming dialogs correctly, etc.. am happy to receive the pull requests.

Where I will draw the line is if it's something that you prefer that it looks like X instead of Y.
One of the things we had hoped to implement early on was a skinning engine to allow you to customize the theme.. The basics are there, just not implemented for CSS themes - and never got round to looking at template changes (i.e. the HTML).
a few things on my must implement/fix list (but is behind my DVR engine backlog right now) are
- list vs tile options on rules, recordings, upcoming and search
- saving default options to config file (list v tile, default page, default num of latest recording)
- updating diagnostics with even more relevant info
- css themes
- add editing of rule to rules page

Happy for anyone to go implement and contribute them of course :)

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by airdrummer » Sun Jan 13, 2019 11:17 am

demonrik wrote:
Fri Jan 11, 2019 11:07 am
I don't let my wife near this app - she would kill me if I forced her to use it :)
...
- add editing of rule to rules page
waf << 0, eh?-)

i found this fork https://github.com/phillipssc/HDHR-DVRUI which has a nice rule edit, including a nice ep.date pulldown
Finally, scheduling was enhanced. Dropdowns replace the guesswork of date time and channel selection for any show. You can now edit an existing rule easily and, of course, add post-processing options to it.
https://github.com/phillipssc/HDHR-DVRU ... itRule.png
i tried to run it as is, but loads with so many errors the dialog dismiss is offscreen & can't even inspect:-\
and as it's 15 commits ahead, 30 commits behind ur master, i'll just have to finally grok git;-}

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by airdrummer » Sun Jan 13, 2019 6:42 pm

the dashboard, with the discovered devices, the recent recs & upcoming recs, would be more useful if those were clickable...

nateb
Silicondust
Posts: 862
Joined: Mon Aug 06, 2018 3:22 pm
Device ID: 1051C73D, 10759F29

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by nateb » Sat Jan 19, 2019 8:36 pm

Out of curiosity, have you ever considered offering this as a docker image?

https://www.linuxserver.io/our-images

I've read that LibreELEC recently added support for installing docker images directly within the UI. It'd be pretty cool to have the setup all ready to go in a single docker install.

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

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by demonrik » Sun Jan 20, 2019 8:53 am

nateb wrote:
Sat Jan 19, 2019 8:36 pm
Out of curiosity, have you ever considered offering this as a docker image?

https://www.linuxserver.io/our-images

I've read that LibreELEC recently added support for installing docker images directly within the UI. It'd be pretty cool to have the setup all ready to go in a single docker install.
I have looked at it - but to do so would need to add an instance of web server and php to the image.
So if I was to do that, I think I'd create another github project for the container - and simply refer to this project to build the image.
Thus keeping this project as clean as I could.

nateb
Silicondust
Posts: 862
Joined: Mon Aug 06, 2018 3:22 pm
Device ID: 1051C73D, 10759F29

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by nateb » Mon Jan 21, 2019 9:29 am

demonrik wrote:
Sun Jan 20, 2019 8:53 am

I have looked at it - but to do so would need to add an instance of web server and php to the image.
So if I was to do that, I think I'd create another github project for the container - and simply refer to this project to build the image.
Thus keeping this project as clean as I could.
Makes sense to me. A touch like how Kodi and LibreELEC are kept separate.

Well, if you do, let me know. I'll see about maybe giving it some social media love.

Lunar
Posts: 16
Joined: Sun Mar 11, 2018 7:02 pm

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by Lunar » Sat Feb 02, 2019 6:41 pm

I'm trying to get the UI up and running as I'm returning to the HDHomerun DVR after being disappointed with Plex. I was previously using this UI a few months ago, but now I'm having the following issue. Whenever I bring up the index page, I get an Error invalid status: +: status: 500 and an improperly formatted page layout. No links work, all reporting the same error. I've tried hosting both the web UI and the DVR service on two different machines, one of which is a fresh install of Ubuntu server 18.04, to no avail. I'm running apache 2 and PHP 7.2. I'm banging my head against the wall on this one. Any help would be much appreciated. Also, the link below is to a screenshot of what the page looks like when accessed.

https://imgur.com/o3ipuKk

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

Re: HDHR-DVRUI - A PHP/Web Interface to your HDHR DVR Setup

Post by demonrik » Sat Feb 02, 2019 9:58 pm

Lunar wrote:
Sat Feb 02, 2019 6:41 pm
I'm trying to get the UI up and running as I'm returning to the HDHomerun DVR after being disappointed with Plex. I was previously using this UI a few months ago, but now I'm having the following issue. Whenever I bring up the index page, I get an Error invalid status: +: status: 500 and an improperly formatted page layout. No links work, all reporting the same error. I've tried hosting both the web UI and the DVR service on two different machines, one of which is a fresh install of Ubuntu server 18.04, to no avail. I'm running apache 2 and PHP 7.2. I'm banging my head against the wall on this one. Any help would be much appreciated. Also, the link below is to a screenshot of what the page looks like when accessed.

https://imgur.com/o3ipuKk
you need to make sure the http service can write the .css
i.e. make sure .../themes/default is writable by the http user on your system

Post Reply