TV Diary - add-on web interface

Just seen an interesting problem...
Recording list shows a programme (Falling Skies) as 3 separate sections with a few minutes between each.
Watched list does not show the short videos that I watched, probably coinciding with the recording gaps.

log shows...
Code:
08/02/2014-21:21:01: Finished activity 1618, 'L', BBC ONE HD, 'The National Lottery: Who Dares Wins', 08/02/2014-20:55:02 - 08/02/2014-21:20:01, 08/02/2014-20:35:00, 50
08/02/2014-22:00:01: Started new activity 1620, 'R', 5*, 'New: Falling Skies', 08/02/2014-22:00:01 - 01/01/1970-00:00:00, 08/02/2014-22:00:00, 60
08/02/2014-22:02:01: Started new activity 1621, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:02:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:02:01: Finished activity 1619, 'P', BBC ONE HD, 'The Graham Norton Show', 08/02/2014-21:21:01 - 08/02/2014-22:01:01, 31/01/2014-22:35:00, 50
08/02/2014-22:03:01: Error listing humaxtv files. [could not read "/mnt/hd2/My Video/_shorts/Ellmau/Rodelbahn Ellmau-Going M\xc3\xa4rz 2013.mp4": No such file or directory]
08/02/2014-22:03:01: Inactivity cleanup of 2 finished activities.
08/02/2014-22:03:01: Finished activity 1620, 'R', 5*, 'New: Falling Skies', 08/02/2014-22:00:01 - 08/02/2014-22:02:01, 08/02/2014-22:00:00, 60
08/02/2014-22:03:01: Finished activity 1621, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:02:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:03:01: Deleted zero length activity 1621, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:02:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:04:01: Error listing humaxtv files. [could not read "/mnt/hd2/My Video/_shorts/Ellmau/Rodelbahn Ellmau-Going M\xc3\xa4rz 2013.mp4": No such file or directory]
08/02/2014-22:05:01: Error listing humaxtv files. [could not read "/mnt/hd2/My Video/_shorts/Ellmau/Rodelbahn Ellmau-Going M\xc3\xa4rz 2013.mp4": No such file or directory]
08/02/2014-22:06:01: Error listing humaxtv files. [could not read "/mnt/hd2/My Video/_shorts/Ellmau/Rodelbahn Ellmau-Going M\xc3\xa4rz 2013.mp4": No such file or directory]
08/02/2014-22:07:01: Error listing humaxtv files. [could not read "/mnt/hd2/My Video/_shorts/Ellmau/Rodelbahn Ellmau-Going M\xc3\xa4rz 2013.mp4": No such file or directory]
08/02/2014-22:08:01: Error listing humaxtv files. [could not read "/mnt/hd2/My Video/_shorts/Ellmau/Rodelbahn Ellmau-Going M\xc3\xa4rz 2013.mp4": No such file or directory]
08/02/2014-22:09:01: Started new activity 1621, 'P', , '03 Short Carving Turns - 12 Steps to Ski Like a Pro - 03.mp4', 08/02/2014-22:09:01 - 01/01/1970-00:00:00, 01/01/1970-00:00:00, 0
08/02/2014-22:09:01: Started new activity 1622, 'R', 5*, 'New: Falling Skies', 08/02/2014-22:09:01 - 01/01/1970-00:00:00, 08/02/2014-22:00:00, 60
08/02/2014-22:12:01: Started new activity 1623, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:12:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:12:01: Finished activity 1621, 'P', , '03 Short Carving Turns - 12 Steps to Ski Like a Pro - 03.mp4', 08/02/2014-22:09:01 - 08/02/2014-22:11:01, 01/01/1970-00:00:00, 0
08/02/2014-22:13:01: Error listing humaxtv files. [could not read "/mnt/hd2/My Video/_shorts/Rodelbahn Ellmau-Going M\xc3\xa4rz 2013.mp4": No such file or directory]
08/02/2014-22:13:01: Inactivity cleanup of 2 finished activities.
08/02/2014-22:13:01: Finished activity 1622, 'R', 5*, 'New: Falling Skies', 08/02/2014-22:09:01 - 08/02/2014-22:12:01, 08/02/2014-22:00:00, 60
08/02/2014-22:13:01: Finished activity 1623, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:12:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:13:01: Deleted zero length activity 1623, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:12:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:14:01: Started new activity 1623, 'R', 5*, 'New: Falling Skies', 08/02/2014-22:14:01 - 01/01/1970-00:00:00, 08/02/2014-22:00:00, 60
08/02/2014-22:14:01: Started new activity 1624, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:14:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:15:01: Started new activity 1625, 'L', BBC ONE HD, 'BBC News', 08/02/2014-22:15:01 - 01/01/1970-00:00:00, 08/02/2014-22:15:00, 15
08/02/2014-22:15:01: Finished activity 1624, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:14:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:15:01: Deleted zero length activity 1624, 'L', BBC ONE HD, 'Casualty', 08/02/2014-22:14:01 - 01/01/1970-00:00:00, 08/02/2014-21:25:00, 50
08/02/2014-22:30:02: Started new activity 1626, 'L', BBC ONE HD, 'Match of the Day', 08/02/2014-22:30:02 - 01/01/1970-00:00:00, 08/02/2014-22:30:00, 90
08/02/2014-22:30:02: Finished activity 1625, 'L', BBC ONE HD, 'BBC News', 08/02/2014-22:15:01 - 08/02/2014-22:29:02, 08/02/2014-22:15:00, 15
08/02/2014-23:00:02: Finished activity 1623, 'R', 5*, 'New: Falling Skies', 08/02/2014-22:14:01 - 08/02/2014-22:59:01, 08/02/2014-22:00:00, 60

The problem seems to be that the file that it is complaining about was downloaded from YouTube and has an a-umlaut in Marz = "M\xc3\xa4rz". This filename is shown correctly on the recorder.
 
Interesting. day_view.Jim isn't used any more. It's day_json.jim now. Perhaps there's over zealous caching in the browser, and it's still using the script.is from 0.0.2-1.
Assuming those messages are all after the upgrade.
Looking for the wrong URL would certainly cause the server error messages.
I am using Google/Chome on iPad to access webif (Safari has problems in iO7) and as I could find no way to clear the cache, I uninstalled it and downloaded it again, which seems to have done the trick. The result is that Tvdiary is better. I still get the time-outs but selecting 'Today' or the date on the calendar a second time it displays correctly. BTW, I have switched off Show Live TV.

Going back as far as 29th Nov I get results for 'Recorded' and 'Watched' including on some days Live TV, but reported as Media with no mast symbol. I think I used to toggle the switch off and on just to see the results. So it looks as if things where OK back then.

I will switch Show Live TV back on and see what happens over the next week.
I do not watch TV programmes through the HD-Fox as my TV has an HD tuner, but it should show the times for my two wake-up timer events in the mornings.

Thanks.
 
Just tried the purge utility to check I had a vague idea if I ever needed it. (1M file at present, so not urgent). Just noted that aborting it gave a runtime error -

humax# /mod/sbin/tvdiary_purge 80
Delete the 88 events between Wed 27 Nov 2013 22:11 and Sun 01 Dec 2013 17:35?
Continue? Y or N>n

OK. Leaving all of the data there.
Runtime Error: /mod/sbin/tvdiary_purge:121: cannot commit - no transaction is active
in procedure 'main' called at file "/mod/sbin/tvdiary_purge", line 121
 
Just tried the purge utility to check I had a vague idea if I ever needed it. (1M file at present, so not urgent). Just noted that aborting it gave a runtime error -

Oh yeah - I was committing a transaction unconditionally, but only beginning it on the yes path.
You won't see a reduction in the file size as I haven't put in a VACUUM statement yet. Also, installing the last release will have expanded the file a bit as I added a couple of extra indexes, and evidently it needed temporary space.

I haven't had the chance to look at other issues for the last couple of weeks as hardware troubles and power cuts have left me PC-less for a while. Nearly back.
 
Sadly in this house, TV Diary has fallen foul of the 'SWMBO Acceptance Factor' and may need to be removed :-( She's not happy that I have a way of knowing exactly what has been watched and when (far too 'Big Brother' was the phrase), so she obviously has something to hide!

Perhaps we should have an option of an 'incognito' install mode, whereby there is no obvious webif component to give the game away, but it keeps dutifully logging stuff in the background for extraction as necessary by the more tech savvy ! :)
 
That's a pity. I'm sure she would have loved the upcoming release with monthly summaries of what's been watched! (see below)

The next step is to build a favourites list so it can show suggestions when programmes appear in the schedule, filtering out those episodes you've already seen.

The "Big Brother" bit isn't a surprise, since I got the idea from negative press reports about LG TVs logging your viewing!
I've been contemplating how to get it to work with separate viewers' histories, but that got me started down an even Bigger Brother route, having cameras and facial recognition.

You could go stealthy by deleting a few files, but I wouldn't condone subterfuge. I've hacked my TomTom satnav to record the routes for plotting on maps, and even though it's just for me, I got it by default to periodically read out a warning that the journey's being recorded. You have to consider the ethics and trustworthiness of software.

She would certainly be happy that I've completely dropped the idea of a direct feed to Facebook.
 

Attachments

  • monthly.png
    monthly.png
    58.7 KB · Views: 20
I've uploaded a new version of TV Diary - 0.0.3-0.

You can see a snapshot view at http://www.wink.eclipse.co.uk/tvdiary/

The main difference is that it now aggregates the historical information, and presents monthly summaries.
It's got a more efficient database schema, which requires a migration for older installations.
Please be patient as it could take a minute or so. Sorry, I wasn't able to test updating through the WebIf until I'd published to update. It doesn't seem so long at the command-line!
Wait until the update's Processing request dialog disappears and the installation is complete.

It's got a more phone/tablet friendly interface, switching between tabs instead of using dialog boxes.
On the main daily diary tab, the "remote control" switch for showing live times has gone, but you can still directly tap the live label to toggle it on and off.
Clicking on a repeat/deja vu icon against a programme takes you to the programme search tab to show you all activities with the same programme title and synopsis.
Clicking on the video available icon against a programme takes you to the inventory tab.

In the monthly summaries tab you can see viewing history aggregated by programmes and by channels. The tables can be sorted, depending on whether you want to rank programmes by the amount you recorded, or the amount you actually watched.
In the programmes summary table you can click on the program titles to search for all activities with that title and channel. You can then adjust the search criteria to perhaps widen the search by searching for the title containing rather than equalling, so removing the channel name qualification.
(In the snapshot demo view mentioned above, these links work, but the search is mocked up only to search for programmes with "cycle" in their synopsis.

The settings have been updated. You can control whether monthly summaries are included. (By default you're not.) You can also control whether the inventory is included or not. (By default it's not.)
When you first turn these on it may take a minute to build the initial caches. The UI should indicate it can't get exclusive access to the database yet, but a refresh shortly later should succeed. Once it's going, keeping the data up to date should rarely be visible. The monthly summary for the current month is updated at the configured start of the TV day, or ASAP after the machine wakes up.

This release is really a stepping stone to heuristically building a favourites list of programmes, or search terms, and then applying them to the EPG, filtering out or highlighting those that have already been seen or are already scheduled for recording.

In the mean time it allows a peek into the stats that can be derived from your historic viewing data. I was tempted to do a graph of time spent viewing different channels, but decided that was too much of a diversion. I may add download for importing into a spreadsheet instead.
I'm not sure I can reliably read too much into the total time spent watching programmes. Is a long time good, or does it just mean the programme didn't grip your attention enough to stop you putting it on pause while you did something more interesting instead?! I suspect the tables will help prompt users to find their favourite programmes, rather than automatically determining them. For me, it would put BBC News top of the list, when in fact it's the default live channel when I'm not actually watching anything.

The command-line tvdiary_purge is still present if you don't want to keep older information, and now does compact the database file when it's finished. For me, with a lot of viewing data because I've been testing, the DB is now 2MB for 6 months' data.
 

Attachments

  • DiaryTop.png
    DiaryTop.png
    144.3 KB · Views: 22
  • DiaryBottom.png
    DiaryBottom.png
    190.3 KB · Views: 21
  • SummaryPrograms.png
    SummaryPrograms.png
    126.7 KB · Views: 22
  • SummaryChannels.png
    SummaryChannels.png
    100.2 KB · Views: 21
  • SearchFromSummary.png
    SearchFromSummary.png
    68.6 KB · Views: 20
  • ManualSearch.png
    ManualSearch.png
    62.9 KB · Views: 21
  • Inventory.png
    Inventory.png
    293.8 KB · Views: 25
  • Settings.png
    Settings.png
    114.1 KB · Views: 23
0.0.3-0 had difficulty processing my existing 2MB db file so I had to delete it (I was probably just being impatient), Some very good features added. One suggestion, that 'Programme Search' could be called 'History Search' to indicate that only watched / recorded items will be returned in the search, rather than an EPG search. I will get the new screens into the WiKi Today - Thanks
 
I like the monthly summary, especially the channel summary.
It would appear that BBC One is outright winner in our house. Not really a surprise, but I hadn't realised how far ahead it really was.
 
Looks like some great features, especially the direct access to the Inventory (since I'm not interested in the already watched flags etc), monthly summary and possibly the search, though I suspect I'm more interested in a search/sorting of the Inventory itself.

It did catch me out that inventory and monthly summaries are off by default and I think mine took a fair while to build the initial caches after turning them on.

Many thanks.
 
This is a very nice update (as always) and nicely written code that I can learn from too! I particularly like the minimal tabs.
Sorting doesn't seem to be working for me on the Recorded/Played/Live columns though - haven't looked to see why yet.
 
Excellent features

Monthly summary interesting and inventory with summary description has already turned up some programmes I'd forgotten I'd recorded! Think I'll be using this a lot.

Thank you
 
Back
Top