TV Diary - add-on web interface

I think 4291 is complaining about this (but being at the end of the page it would have helped if he had quoted it ;)):

Sounds similar to my #55 comment. I presume it didn't spot it for one minute (10:59 in your case) and therefore thinks it is a new program.
 
Complaining? I hope I haven't upset anyone. I was just trying to link the two incidents.
(possibly I phrased it poorly. I had meant that the incidents sounded similar/same)
 
Complaining? I hope I haven't upset anyone. I was just trying to link the two incidents.
(possibly I phrased it poorly. I had meant that the incidents sounded similar/same)
Don't worry about it, it's just a little dig about the difference between a program* and a programme**.

* program: series of instructions to be carried out (usually by a computer);
** programme: advertised series of events, one item in such a series (TV or radio).

For much more like this, see Assume v Presume.
 
Ah - I might be in trouble then. Too many years working for an American company. Software is written in locale en_US, and the first localization is into en_GB!
 
@Teg #51 - I don't know the capabilities of Wordpress or Blogger, but there's a good chance you can get the data in.
/mod/webif/html/tvdiary/day_view.jim is both a CGI and CLI program, and I've included the program /mod/sbin/tvdiary_publish.jim which renders to a temp file and FTPs that off to another server.
You could also have a machine, within your firewall, call curl to fetch the data. (I've had to use curl because wget doesn't handle digest authentication.)
Please be aware that although it's currently rendering an HTML table, I'm planning to change it to a more semantically descriptive XML, and to use CSS to style it as a table.
So if the blogs can embed XML and style it (which I would expect them to be able to do - it's 2013) then Bob's your uncle.

@4291 #53 - I didn't think anyone would be that bothered, although as your first experience will be to only see scheduled recordings, I can see it would be jarring. And it's only after recording has started that you see the subtle difference in presentation. As I typed the code to switch between "Recorded" and "To be recorded" I did hesitate and considered putting in "Recorded/To be recorded" for today's date. I'll reconsider that.

@cloud9 #55 & @4291 #59- I've spotted that a few times, but put it down to the fact that I keep changing scripts and stopping and starting things. I was going to keep an eye on the phenomenon and debug it once things quieten down.

I have a feeling that I ought to show which programs are still being recorded or played or watched. I keep seeing the short recording times, compare it with the scheduled duration, look at the end time, then look down at the clock on the bottom right of the screen, do a bit of mental arithmetic and then think to myself - ah it's still recording! In keeping with the "Don't Make Me Think" mantra of web usability (Steve Krug, 2006, New Riders press) I think it should be more obvious. (@4291 #53 - I probably made you think - I apologize! ;) )

I've modified the status checking to distinguish between playback and live watching. I'm basing live watching on access to the /mnt/hd2/Tsr/0.ts file (Time Shift Recording?) rather than the absence of watching anything else. This seems to be more accurate, and means that live watching at the same time as streaming to another device will be included, but it won't think you're watching live when you're in the TV Portal, as it used to do.
I know some of you won't be happy at including yet more live watching! So I've implemented an option to exclude ALL live watching from the DB. I haven't added a UI for changing it yet though; it's just a value you can change at the top of the tvdiary_status.jim file for the moment.
Alternatively, you can include live watching to the DB and then use CSS to change how those rows are displayed, since I'm flagging it in an attribute. I'll explain more when I re-release the package.

There's one corner case where live watching can't be detected. That's when you're recording a program (scheduled or hitting the record button live) and you're also watching the same program REALLY LIVE. That is, not paused at all. In that case humaxtv has the named recording file open and no Tsr/0.ts file. If you pause it does start accessing the Tsr file, but if you fast forward to the end, and the TV screen says "Live broadcast", it stops using the Tsr file.
I figure that most PVR users will choose to chase play a recorded program through the MEDIA button rather than watch it live, but then I don't watch X Factor etc or live tweet about a program. Those people might want to watch live in order to be right up to the moment. Although, why you'd want to record and see X Factor twice is totally beyond me!
Anyway, in that case there'd be a record of you recording the show, but not of having watched it then. If you subsequently do play the recording that will of course be shown.
 
I have a feeling that I ought to show which programs are still being recorded or played or watched. I keep seeing the short recording times, compare it with the scheduled duration, look at the end time, then look down at the clock on the bottom right of the screen, do a bit of mental arithmetic and then think to myself - ah it's still recording!

That happened to me yesterday : ). Maybe include a progress bar for things still being recorded in the same way that the webif schedule page does?

I've modified the status checking to distinguish between playback and live watching. I'm basing live watching on access to the /mnt/hd2/Tsr/0.ts file (Time Shift Recording?) rather than the absence of watching anything else.

Nice, that should also stop it from flagging live watching when tuned into an off-air channel. My box always comes on at the BBC Red Button channel so that it isn't constantly writing the TSR buffer. The most common use case is that a programme is then picked from the library and watched or something is streamed to the bedroom. When the programme finishes, if I'm distracted the TV can site on the red button screen for quite a while before I either turn it off or start watching something else.

I think that chase playing is identifiable by 0.ts being open twice but it's a while since I looked at the status code.
 
@4291 #53 - I didn't think anyone would be that bothered, although as your first experience will be to only see scheduled recordings, I can see it would be jarring. And it's only after recording has started that you see the subtle difference in presentation. As I typed the code to switch between "Recorded" and "To be recorded" I did hesitate and considered putting in "Recorded/To be recorded" for today's date. I'll reconsider that.
I am not bothered. I like to try out new things to see what they can do, and report what I see. I hope my comments are of some use to you.

@cloud9 #55 & @4291 #59- I've spotted that a few times, but put it down to the fact that I keep changing scripts and stopping and starting things. I was going to keep an eye on the phenomenon and debug it once things quieten down.
Thanks.
 
Excellent package, really like it

It's already started an argument though as my wife claims the TV was on but she was not watching the rubbish logged last night

She has asked for a feature enhancement to show if she was actually in the living room watching as opposed to in the kitchen with the TV left on!
 
So we need a USB webcam driver then such that a thumbnail can be recorded in the diary of who was sitting on the sofa during each logged programme! Big Brother methinks - there could be trouble ahead!
 
Actually I have another project that uses Open CV to recognise dressage horses (don't ask!) I'm sure that could be adapted. Or, if you've got a Kinect !
 
Hi there...

I've uploaded a new version of TV Diary: tvdiary_0.0.2-0_mipsel.opk

I've taken your feedback on board, and it now distinguishes between playing back recordings and watching live TV.
You can hide the live programmes if you don't want to be bothered with them.
If you really want to permanently disable the detection of all live broadcasts, there's a flag you can change at the top of /mod/dev/tvdiary_status.jim.
It also makes it clearer which programmes are being recorded or watched at the moment (or rather when the page was updated).

I've added the /mod/sbin/tvdiary_purge.jim utility to remove aged data from the /mod/etc/tvdiary.db database. You specify the number of days' data to retain on the command line, and it reports how much data will be removed and prompt for confirmation before deleting it. Or, if you're brave or automating it, you can specify Y on the command line and it won't prompt.

I haven't switched over to XML instead of an HTML fragment - life's too short - but the table's got more information attached that JavaScript can access.
If you wanted to display more than one day at a time, you could make repeated Ajax requests and concatenate the table contents together, removing any duplicated shows that span the day boundary. You can add date subheadings between them, and calculate the overall durations for the combined tables. This is how the table headings are calculated.

It's got the new method for detecting programs being watched live, based on the TSR file, so it should be more accurate.

I'm still seeing the bug where occasionally recorded programs are shown split into two blocks. The actual recording is complete. Logging is turned on to show when programs start and finish, and from a single observation so far it appears that the Humax switches from recording a show to playing it back, then back to recording it. It *could* be that the file stops growing for a few seconds, since recording is determined from seeing the file get larger. I'm still investigating this, and will fix it when I'm more certain.
cheers...
 
That's looking good.
Just one minor request for consideration; would it be possible on the Watched list to indicate which are live and which are replayed (you obviously have that information for the filter/switch).
 
You can hack the .../tvdiary/style.css to customize the way live program(mes) are displayed.
Code:
/* Live broadcast icon. */
tr.live_event td.event_time:before /*, tr.record_event.active_event td.event_time:before*/ {
  content: url('tvmast.png');
  float: right;
}
The commented out section there was where I toyed with the idea of showing the TV mast against programs currently being recorded, but decided against it.

Previously I had the channel name in lilac, for no better reason than lilac and live start with the same letter!
Code:
/* Live broadcast shown lilac. */
tr.live_event td.tvchannel div {
  color: #000000;
  background: #d6b2d6;
}
 
I'm still seeing the bug where occasionally recorded programs are shown split into two blocks. The actual recording is complete. Logging is turned on to show when programs start and finish, and from a single observation so far it appears that the Humax switches from recording a show to playing it back, then back to recording it. It *could* be that the file stops growing for a few seconds, since recording is determined from seeing the file get larger.
That sounds right. You could afford a longer delay between the open file scans than I can with status.

I've added the /mod/sbin/tvdiary_purge.jim utility

Would you consider dropping the .jim file extensions for the parts in /mod/sbin? It isn't usual to use extensions for files in the system bin directory on Unix - they're commands regardless of the language. The extensions are required, however, for the files in the web root so that the web server knows to execute them as CGI.
 
Very nice.
It seems to be ignoring off-air channel (BBC3) even with the Show Live TV=YES, which is good (but initally stumped my attempts at checking the filtering). I assume that is part of the "more accurate live TV detection".
And I've now had a chance to play with the live TV filtering - looks very good.
Watched - 10:31 (Media: 5:24 / Live: 5:07 )

One other thing that happens fairly regularly here is programmes left paused for some time (baby waking up etc). So a 45 min programme says it was playing for 182 mins when really only 7mins playing had occurred. Which initially seems odd, but I don't really know if it is wrong as such nor what a better solution would be without an easy pause/play detection, but just thought it was worth mentioning in case there were any bright ideas.

[I am so used to only ever writing program that I struggle with remembering to use programme]
 
Back
Top