TV Diary - add-on web interface

Code:
{
"current_time": 1391807552,
"time_start": 1391745600,
"time_end": 1391832000,
"events": [
  {
  "type": "record",
  "active": false,
  "watched": false,
  "repeat_id": -1,
  "available": false,
  "event_start": 1391778601,
  "event_end": 1391778841,
  "event_duration": 4,
  "scheduled_start": 1391775300,
  "scheduled_end": 1391778900,
  "scheduled_duration": 60,
  "channel_name": "Channel 5",
  "channel_icon_path": "/img/channels/out/Channel%205.png",
  "title": "Home and Away",
  "synopsis": "Documentary series profiling the work of a high-speed police interception unit who are trained and equipped to tackle the most evasive criminals on a daily basis. [S]"
  },
  {
  "type": "record",
  "active": false,
  "watched": true,
  "repeat_id": -1,
  "available": true,
  "event_start": 1391778901,
  "event_end": 1391780762,
  "event_duration": 31,
  "scheduled_start": 1391778900,
  "scheduled_end": 1391780700,
  "scheduled_duration": 30,
  "channel_name": "Channel 5",
  "channel_icon_path": "/img/channels/out/Channel%205.png",
  "title": "Home and Away",
  "synopsis": "Unaware of Casey and Tamara's decision, April railroads them into serving as best man and maid of honour. April also gets some good news from Paris. [AD,S]"
  },
  {
 
This is what I get.
{ "status": "Timed out acquiring exclusive access to the database. Try again later." }

This is the one I'd expected first time round, particularly if you have a lot of saved videos. However it shouldn't be a recurring problem. Also, only this message text should appear on screen, not the "Sorry, unavailable due to server error" message.

You mention that you've got an HD Fox rather than an HDR. I'm now using [system mediaroot] to locate the recorded video files, which should report "/media/drive1/Video" instead of "/media/My Video", and should therefore isolate me from differences. I'm also getting [system dustbin] to get the [Deleted Items] path. Again this should isolate my code, although I haven't tested with there being no dustbin.

How many video files do you have stored? (Just very roughly - tens, hundreds?) I've tested after filling my 1Tb disk with videos and it's not caused more than the one-off timeout.

Once a request gets hold of the DB lock then it doesn't matter how long its work takes, so if you can't get the lock it means that something has gotten the lock and just isn't giving it up. If the process handling the request dies then the lock automatically gets released. So if there's something really long lived holding the lock then it's worrying.

Can you try it again to see if it's been released?
cheers...
 
Mine is HDR-FOX T2 - still getting server error - SWMBO has declared 'bed-time' - will leave you night owls to play!!
 
Code:
  "synopsis": "Unaware of Casey and Tamara's decision, April railroads them into serving as best man and maid of honour. April also gets some good news from Paris. [AD,S]"
  },
  {

Is this the entirety of the output, to the very end?

It's all looking very healthy as it goes, but then it seems to die just before the next programme. I can't see what would cause the output to stop at that precise point. The text should go all the way down to the status and the closing bracket.


Code:
  "synopsis": "Click tries out the latest in hi-tech toys at the UK's biggest toy fair. Plus composing music using your mind and fixing your car with artificial reality. Also in HD. [S]"
  }
],
"status": "OK"
}
 
I have about 60 recordings (80GB)

It's working a bit hit and miss. Today shows nothing recorded and times out. I have since watched the recording I made today and it is reported correctly. Previous days' recordings are reported on some days but not others although I have a daily series recording scheduled. Switching between days eventually confuses it.

Modifying the URL gives the same error message or { "status": "EMPTY" }
 
Although the Humax has been on all evening nothing is being shown as 'watched'. Show live TV: YES
 
Excellent.
I am especially impressed with the video inventory, though isn;t it something that should have a top level link/entry point, since it is essentially an alternative browse view.

Indeed, rather than replicate, would it make more sense for some of the features to be available from the webif browser view. I am not sure what is involved in this and how much time from af123 would be needed nor even which would be the best, but it just seems that it might be worth looking at an integrated view.
Yes. I'm thinking of the inventory as an experiment at the moment. I felt challenged by earlier comments, and wanted to see if I could efficiently present a view that would help me choose which of the backlog of recordings I want to watch. The WebIf Browse page's filenames don't help, although the tooltip synopsis goes a little way. You get the same effect on the TV screen by stepping through each recording and hitting the "i" button.
I hate having to drill down levels to get at information.

I was a little confused by some of the icons. e.g. the eye icon being unwatched (rather than watched), but am getting used to them.
I went for unwatched rather than a watched icon so that it serves as an exception and maybe a call to action, rather than cluttering everything you've watched with an icon. But I'm certainly open to suggestions (that fit in 16x16!). To be honest I was tempted to go with some sort of "new" flag like WebIf and Humax folders have, but I was drawn back so that I could do a struck-out eye to show what was deleted without being watched.

One final note, I forgot to ask before - is the purging of the watched db still manual and do you have any plans for an auto facility. I must remember to look at how big the file is and check if I need to do a manual purge (and look back in this thread for the instructions).
It's still manual. Of course, if you do purge old data then the "deja vu" indication will be limited to what remains, which limits its usefulness. But in practice it's also limited by its dependence on spotting identical synopses. It may be another experiment which doesn't stand up in practice.

When I get around to the summary statistics, I'll make sure you have the opportunity to drill into the summaries if it's available, or just the summary if you're compacting things.
I may make the summary generation a periodic task that purges the transaction data when finished.

Thanks for the feedback.
 
Some good new features, I am getting this icon View attachment 983 with 'Deleted Unwatched' against it for a programme that is still on the Hard drive that was recorded on Sun 2 Feb 2014 19:00 and watched on 4 Feb 2014. I would have expected to see this symbol but with 'Watched' against it

If the programme is still on the disk then there must have somehow been a change to the title or synopsis. It does a simple equality test of both to match videos and recordings. As I put it together I did think that it might be susceptible to any other packages that manipulate video files if they re-wrote the title or synopsis in any way, even if it's removing redundant repeated spaces in the text. Might anything like that have happened?
I did consider including the contents of the [Deleted Items] folder, but for performance they're filtered out and treated as completely deleted, even though they're still on the disk.
Also, I suspect if you've got additional disks attached I won't spot their contents.

As I mentioned earlier, I decided to go for the Unwatched icon rather than a Watched icon because I wanted an un-cluttered display, with only icons for exceptions and as a call to action. If you've watched a recording then it can just sit there quietly like a video on the shelf. Unless you have an alternate use-case, where the call to action should be to delete what you've already watched, as opposed to the action being to watch what you haven't already watched. Different emphasis for different use-cases.

Thanks for updating the Wiki. Although the label for the struck out eye should say "Deleted without having been watched" rather than "Watched Recording". I do like to see it - it makes me feel like I've been discerning. Though it's also a defeat that I recorded it in the first place.

Thanks for the updates and the feedback.
 
Although the Humax has been on all evening nothing is being shown as 'watched'. Show live TV: YES

It sounds like the status checking isn't working. The logging level is set to report when programmes start and stop, so you should see something like:
Code:
07/02/2014-20:59:01: Finished activity 4669, 'R', BBC ONE HD, 'Room 101', 07/02/2014-20:29:01 - 07/02/2014-20:58:02, 07/02/2014-20:30:00, 30
07/02/2014-22:01:02: Started new activity 4670, 'R', BBC TWO HD, 'Alan Davies Apres-ski', 07/02/2014-22:01:02 - 01/01/1970-00:00:00, 07/02/2014-22:00:00, 30
07/02/2014-22:03:02: Started new activity 4671, 'R', Channel 4 HD, 'The Last Leg', 07/02/2014-22:03:02 - 01/01/1970-00:00:00, 07/02/2014-22:00:00, 50
07/02/2014-22:31:01: Finished activity 4670, 'R', BBC TWO HD, 'Alan Davies Apres-ski', 07/02/2014-22:01:02 - 07/02/2014-22:30:02, 07/02/2014-22:00:00, 30
07/02/2014-22:38:01: Started new activity 4672, 'R', BBC ONE HD, 'The Graham Norton Show', 07/02/2014-22:38:01 - 01/01/1970-00:00:00, 07/02/2014-22:35:00, 50
07/02/2014-22:52:01: Finished activity 4671, 'R', Channel 4 HD, 'The Last Leg', 07/02/2014-22:03:02 - 07/02/2014-22:51:01, 07/02/2014-22:00:00, 50
07/02/2014-23:25:01: Finished activity 4672, 'R', BBC ONE HD, 'The Graham Norton Show', 07/02/2014-22:38:01 - 07/02/2014-23:24:01, 07/02/2014-22:35:00, 50
I have found problems with the settings: the on/off button only seems to work ONCE per page reload. So if you toggle it off, then on again it's not taking the on. You'd have to refresh the page and then toggle it. But if there's any logging then it this wouldn't be a factor.
Was it working previously? The only change I've made to tvdiary_status is to put the DB locking for safety.
 
If the programme is still on the disk then there must have somehow been a change to the title or synopsis. It does a simple equality test of both to match videos and recordings. As I put it together I did think that it might be susceptible to any other packages that manipulate video files if they re-wrote the title or synopsis in any way, even if it's removing redundant repeated spaces in the text. Might anything like that have happened?
I'm not sure if what I can see now is the same as it looked when I posted #107, I may have not looked at it closely enough, but as you can see the icon I was asking about is against a 1Min. program that has been split from the main programme following it, so the split probably caused the problem

tv-diary-split.jpg

Thanks for updating the Wiki. Although the label for the struck out eye should say "Deleted without having been watched" rather than "Watched Recording". I do like to see it - it makes me feel like I've been discerning.
WiKi now updated HERE, if you need any other changes let me know

EDIT
I think I know what is happening with the deleted-unwatched.png icon, if I watch 57 Minutes of a 60 Min. recording, stop viewing and delete the recording, I get an entry in TV-Diary showing this icon against a 3 Min. programme i.e. the bit I didn't watch
 
I have to say, this is beautifully written code, making good use of the libraries provided by web interface.
(Even though I'm an 80-columns, Allman style advocate! [accepting that Jim/TCL doesn't entirely support that])

It's a fine example of how good HTML/CSS/AJAX code should be written with clear separation of the framework, style and code. Rather a stark contrast to some other parts of the web interface, I'm afraid. I'm a systems programmer who has learned HTML/CSS/AJAX through this project and I'm getting better but some of the early stuff is decidedly embarrassing now!

It's kind of you to say so, as I climb on your shoulders:) It's very easy to re-use the WebIf components and I've learned a lot. Although my Object Oriented TCL is like my French - I can read it, but I'm not quite up to writing it.
I used to be an Allman devotee too, but had it knocked out of me in the last few years. But I'm currently freaking out at Python, suffering bracket withdrawal!

Going for JSON was the key for simplifying things. I'm an old hand at XML, but I started on a dead-end trying to send XML and style that. That just got more and more complicated.

Cheers...
 
Was it working previously? The only change I've made to tvdiary_status is to put the DB locking for safety.
Yes. I've tried it again this morning, same result. The first previous day to report 'Recorded' and 'Watched' correctly is the 4th Feb., but no TV.
 
I have gone back and re-read your post #104 and tried the Today button as suggested. The result instantly shows the programmes that are due to record later. 'Watched' still shows 'Nothing'. Humax is on.
 
As an experiment I have tried an instant record of a live programme. The result after using the 'Today' button is that the programme is shown as being 'Watched', but only for the duration of the recording. Changing channel has no effect.
 
I have gone back and re-read your post #104 and tried the Today button as suggested. The result instantly shows the programmes that are due to record later. 'Watched' still shows 'Nothing'. Humax is on.

Can you check the tvdiary.log contents under Diag to see what sort of records are being saved.
Also, check the Settings to see whether the monitoring turned on.
Finally, is the main WebIf status showing what's recording or playing?
cheers...
 
Yes, yes & yes.

Code:
>>> Contents of /mod/tmp/tvdiary.log 4.08 KiB
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
07/02/2014-21:42:01: Inactivity cleanup of 2 finished activities.
07/02/2014-21:42:01: Finished activity 214, 'R', Channel 5, 'Neighbours', 07/02/2014-14:15:01 - 01/01/1970-00:00:00, 07/02/2014-13:45:00, 30
07/02/2014-21:42:01: Finished activity 215, 'L', Channel 5, 'CSI: New York', 07/02/2014-14:15:01 - 01/01/1970-00:00:00, 07/02/2014-14:15:00, 60
07/02/2014-21:42:01: Deleted zero length activity 214, 'R', Channel 5, 'Neighbours', 07/02/2014-14:15:01 - 01/01/1970-00:00:00, 07/02/2014-13:45:00, 30
07/02/2014-21:42:01: Deleted zero length activity 215, 'L', Channel 5, 'CSI: New York', 07/02/2014-14:15:01 - 01/01/1970-00:00:00, 07/02/2014-14:15:00, 60
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
07/02/2014-22:22:01: Started new activity 214, 'P', Channel 5, 'Neighbours', 07/02/2014-22:22:01 - 01/01/1970-00:00:00, 07/02/2014-13:45:00, 30
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
07/02/2014-22:42:01: Inactivity cleanup of 1 finished activities.
07/02/2014-22:42:01: Finished activity 214, 'P', Channel 5, 'Neighbours', 07/02/2014-22:22:01 - 07/02/2014-22:41:01, 07/02/2014-13:45:00, 30
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
08/02/2014-08:22:01: Started new activity 215, 'P', ITV, 'Benidorm', 08/02/2014-08:22:01 - 01/01/1970-00:00:00, 06/02/2014-21:00:00, 60
08/02/2014-08:34:01: Inactivity cleanup of 1 finished activities.
08/02/2014-08:34:01: Finished activity 215, 'P', ITV, 'Benidorm', 08/02/2014-08:22:01 - 08/02/2014-08:33:01, 06/02/2014-21:00:00, 60
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
08/02/2014-08:38:01: Started new activity 216, 'R', BBC ONE East E, 'Breakfast', 08/02/2014-08:38:01 - 01/01/1970-00:00:00, 08/02/2014-06:00:00, 240
08/02/2014-08:38:01: Started new activity 217, 'L', BBC ONE East E, 'Breakfast', 08/02/2014-08:38:01 - 01/01/1970-00:00:00, 08/02/2014-06:00:00, 240
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
08/02/2014-08:43:01: Inactivity cleanup of 2 finished activities.
08/02/2014-08:43:01: Finished activity 216, 'R', BBC ONE East E, 'Breakfast', 08/02/2014-08:38:01 - 08/02/2014-08:40:01, 08/02/2014-06:00:00, 240
08/02/2014-08:43:01: Finished activity 217, 'L', BBC ONE East E, 'Breakfast', 08/02/2014-08:38:01 - 08/02/2014-08:40:01, 08/02/2014-06:00:00, 240
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
Cannot acquire exclusive lock for tvdiary.tb. Terminating.
08/02/2014-08:54:02: Started new activity 218, 'R', Yesterday, 'Find My Past', 08/02/2014-08:54:02 - 01/01/1970-00:00:00, 08/02/2014-08:05:00, 60
08/02/2014-08:54:02: Started new activity 219, 'L', Yesterday, 'Find My Past', 08/02/2014-08:54:02 - 01/01/1970-00:00:00, 08/02/2014-08:05:00, 60
08/02/2014-09:00:02: Finished activity 219, 'L', Yesterday, 'Find My Past', 08/02/2014-08:54:02 - 08/02/2014-08:59:02, 08/02/2014-08:05:00, 60
08/02/2014-09:15:02: Inactivity cleanup of 1 finished activities.
08/02/2014-09:15:02: Finished activity 218, 'R', Yesterday, 'Find My Past', 08/02/2014-08:54:02 - 08/02/2014-09:04:01, 08/02/2014-08:05:00, 60
 
Back after night's sleep. Referring back to post 124 I only inputted first screen as it seemed a large listing, and not realising that you needed the whole stream - trying again with all selected, taken this morning. The last line states Status good, but still no luck with diary display???

Code:
{
"current_time": 1391807552,
"time_start": 1391745600,
"time_end": 1391832000,
"events": [
  {
  "type": "record",
  "active": false,
  "watched": false,
  "repeat_id": -1,
  "available": false,
  "event_start": 1391778601,
  "event_end": 1391778841,
  "event_duration": 4,
  "scheduled_start": 1391775300,
  "scheduled_end": 1391778900,
  "scheduled_duration": 60,
  "channel_name": "Channel 5",
  "channel_icon_path": "/img/channels/out/Channel%205.png",
  "title": "Home and Away",
  "synopsis": "Documentary series profiling the work of a high-speed police interception unit who are trained and equipped to tackle the most evasive criminals on a daily basis. [S]"
  },
  {
  "type": "record",
  "active": false,
  "watched": true,
  "repeat_id": -1,
  "available": true,
  "event_start": 1391778901,
  "event_end": 1391780762,
  "event_duration": 31,
  "scheduled_start": 1391778900,
  "scheduled_end": 1391780700,
  "scheduled_duration": 30,
  "channel_name": "Channel 5",
  "channel_icon_path": "/img/channels/out/Channel%205.png",
  "title": "Home and Away",
  "synopsis": "Unaware of Casey and Tamara's decision, April railroads them into serving as best man and maid of honour. April also gets some good news from Paris. [AD,S]"
  },
  {
  "type": "record",
  "active": false,
  "watched": true,
  "repeat_id": -1,
  "available": true,
  "event_start": 1391780822,
  "event_end": 1391782561,
  "event_duration": 29,
  "scheduled_start": 1391780700,
  "scheduled_end": 1391782500,
  "scheduled_duration": 30,
  "channel_name": "Channel 5",
  "channel_icon_path": "/img/channels/out/Channel%205.png",
  "title": "Neighbours",
  "synopsis": "Amber fears for the future after discovering that Josh will be away at a training camp in Spain for three months. Toadie is devastated after Sonya tells all. [AD,S]"
  },
  {
  "type": "record",
  "active": false,
  "watched": true,
  "repeat_id": -1,
  "available": false,
  "event_start": 1391803201,
  "event_end": 1391804941,
  "event_duration": 29,
  "scheduled_start": 1391803200,
  "scheduled_end": 1391805000,
  "scheduled_duration": 30,
  "channel_name": "BBC ONE East W",
  "channel_icon_path": "/img/channels/out/BBC%20ONE%20East%20W.png",
  "title": "EastEnders",
  "synopsis": "Kat is excited that Alfie is back, but a surprise encounter leaves her reeling. Carol makes an important decision, and Tamwar delivers an ultimatum. Also in HD. [AD,S] Then BBC News."
  },
  {
  "type": "record",
  "active": false,
  "watched": true,
  "repeat_id": -1,
  "available": true,
  "event_start": 1391806801,
  "event_end": 1391810341,
  "event_duration": 59,
  "scheduled_start": 1391806800,
  "scheduled_end": 1391810400,
  "scheduled_duration": 60,
  "channel_name": "BBC ONE East W",
  "channel_icon_path": "/img/channels/out/BBC%20ONE%20East%20W.png",
  "title": "New Tricks",
  "synopsis": "10\/10. The Fourth Man: When the team reinvestigate a 30-year-old safety deposit robbery, they find themselves drawn into a case involving high-level police corruption. Contains adult themes.  [AD,S]"
  }
],
"status": "OK"
}
 
Don't know if relevent but here is Mongoose error log - Cause or Effect??
I would still be interested to try earlier release to see if problem was introduced by release 0.0.2-2

Code:
>>> Contents of /var/log/mongoose_error.log 540.00 bytes
[1391881246] [error] [client 192.168.0.2] GET /tvdiary/day_view.jim: Error 404: Not Found
[1391881246] [error] [client 192.168.0.2] GET /tvdiary/day_view.jim: Error 404: Not Found
[1391881324] [error] [client 192.168.0.2] GET /tvdiary/day_view.jim: Error 404: Not Found
[1391881324] [error] [client 192.168.0.2] GET /tvdiary/day_view.jim: Error 404: Not Found
[1391883319] [error] [client 192.168.0.2] GET /tvdiary/day_view.jim: Error 404: Not Found
[1391883319] [error] [client 192.168.0.2] GET /tvdiary/day_view.jim: Error 404: Not Found
 
Don't know if relevent but here is Mongoose error log - Cause or Effect??
I would still be interested to try earlier release to see if problem was introduced by release 0.0.2-2

Code:
>>> Contents of /var/log/mongoose_error.log 540.00 bytes
[1391881246] [error] [client 192.168.0.2] GET /tvdiary/day_view.jim: Error 404: Not Found

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.
 
Back
Top