TiVo Community Forum banner
41 - 60 of 168 Posts

· tivo_xml developer
Joined
·
1,818 Posts
gman622 said:
another update.....

1. another (sortable) column was added: Expires. now you can see which show will be deleted first, second, third and so on. (finally a use for the keep until date!)

2. multiple tivos are supported (though i'm not sure how well... i only have one)

3. requests are asynchronous, so the browser will not hang on lengthy GETs
(the tab/title will let you know when it's done loading)

4. now recording info will tell you if it's a planned or suggested recording.

here 'tis:
http://home.ripway.com/2005-2/266393/nowPlaying.xhtml
Just keeps getting better :)

/edit: See gman's post above directly above this one, we were both replying at the same time, and I'll bet he has the better answer.
To the users with the cdata error: Are you using any extensions that might cause a conflict? Are you using the most recent released version of Firefox(1.0.2 as of today)? If not, what version are you using? You could perhaps try creating a clean profile in Firefox.
 

· Cat God
Joined
·
17,238 Posts
gman622 said:
another update.....

1. another (sortable) column was added: Expires. now you can see which show will be deleted first, second, third and so on. (finally a use for the keep until date!)
The page never finished loading when I tried it. It downloaded a number of the expiration information and then started generating javascript errors. I got about 50 of the following error:
Error: zuluTime has no properties
Source File: file:///d:/TiVo/nowPlaying.xhtml
Line: 99
If I lower the amount of shows downloaded to around 5 than I don't get errors. I checked the .status field of the returns and the ones that get errors have a status of 503 (which is gateway timeout). If I had to guess I would say that the TiVo can't handle that many requests at once. It seems to max out at around 9 connections at once.

Instead of sending all the requests at once, you should probably pace the requests and send around 5 at once to start. Then as each request comes in you can send out another request.

I couldn't figure out how to easily send out 5 requests at once without losing count (a global variable could be used), but the following will send out 1 at a time which seems to work rather well:

In getContent around line 77 change
Code:
            for (i = 0; i < tblNP.rows.length; i++) {
                getExpDate(tivo_ip, tblNP.rows[i].cells[2], i, tblNP.rows.length-1);
            }
to
Code:
 getExpDate(tivo_ip, 0, tblNP.rows.length-1);
Then change getExpDate call to take 3 parameters
Code:
function getExpDate(tivo_ip, node, timesCalled, timesToBeCalled){
    var showId = node.childNodes[0].childNodes[0].nodeValue;
to
Code:
function getExpDate(tivo_ip, timesCalled, timesToBeCalled){
    var tblNP = document.getElementById('nowPlay');
    var node = tblNP.rows[timesCalled].cells[2];
    var showId = node.childNodes[0].childNodes[0].nodeValue;
and finally add and else clause to the if (timesCalled==timesToBeCalled) statement at the bottom of getExpDate
Code:
            else {
                    getExpDate(tivo_ip, timesCalled + 1, timesToBeCalled)
            }
 

· Cat God
Joined
·
17,238 Posts
I updated my version with the latest changes from gman662 or more precisely I incorporated my changes into his new code. I also put my fix above into the code. If you have less than 128 shows on your TiVo then you won't get any benefits from this version (unless you are experiencing the zulutime has no properties error which this fixes).

Just a note, I defaulted to download 10 shows at a time because I added code to update the title page as the shows are downloaded for indication purposes. Feel free to change the value or remove it and it will try to download all the listings at once (or as many as the TiVo will respond with at once which is 128).
 

· Registered
Joined
·
28 Posts
Discussion Starter · #45 ·
morac said:
status of 503 (which is gateway timeout). If I had to guess I would say that the TiVo can't handle that many requests at once. It seems to max out at around 9 connections at once.
hmm, it's been working fine all day for me. i've got 14 shows right now, maybe the max number of requests is 16? would the server be set to only handle that many though? its not a browser setting issue is it?

morac said:
but the following will send out 1 at a time which seems to work rather well:
you're code works ok, except if you sort the columns while the expiration dates are loading then it screws up. it needs a handle to the node for each request. i think it's maybe the better way to do it though.

i'm curious if anyone else is getting these errors, and how many shows(requests) their tivos can handle.
 

· Cat God
Joined
·
17,238 Posts
gman622 said:
i'm curious if anyone else is getting these errors, and how many shows(requests) their tivos can handle.
I figured out the problem. Firefox defaults to only allow 2 open connections per server. This is controlled via the configuration "network.http.max-persistent-connections-per-server" which can be changed by typing "about:config" into the location bar in Firefox.
Many people, including myself bump this value up to a higher number in order to increase download performance (it's in most tweak guides). I use 8. So while 2 connections works with the TiVo, 8 apparently does not. I've tested and anything greater than 4 causes problems.

In any case by default Firefox will only allow 2 open TiVo connections at once so it basically acts like my code except two requests are sent at the same time instead of only one. So it will work as long as the user didn't increase "network.http.max-persistent-connections-per-server" to greater than 4.
 

· Cat God
Joined
·
17,238 Posts
I figured out a way to keep from screwing up the tables when sorting.

I created an array of all the nodes and passed that to getExpDate. It might be better to pass an array of the tr's node ids and then get the cell's node from the id in getExpDate. This might save on memory depending on how pointer to nodes are stored.

In any case this is what I came up with:
Code:
                var nodes = new Array(tblNP.rows.length);
                for (i = 0; i < tblNP.rows.length; i++) {
                    nodes[i] = tblNP.rows[i].cells[2];
                }
                getExpDate(tivo_ip, nodes, 0, tblNP.rows.length-1);
.
.
.

function getExpDate(tivo_ip, nodes, timesCalled, timesToBeCalled){
    var node = nodes[timesCalled];
.
.
.
            else {
                    getExpDate(tivo_ip, nodes, timesCalled + 1, timesToBeCalled)
            }
I update my code with these changes so sorting won't mess up grabing the expiration date. Once again this is only useful for people who either have more than 128 shows or increased their "network.http.max-persistent-connections-per-server" value to a number greater than 4.
 

· Registered
Joined
·
28 Posts
Discussion Starter · #49 ·
A small update and limitation workaround.
I added some detail to what's now recording (quality, expiration date, and partial recording time.)
I also fixed an error whereby any bad requests that are made are simply resubmitted- not a great fix but...(shrug). And still I get strange behavior if pipelining is enabled. It seems the TiVo's little webserver is easily overwhelmed. I'm curious what server is in there - probably a small custom one they wrote themselves?

Anyway: nowPlaying.xhtml
 

· Registered
Joined
·
28 Posts
Discussion Starter · #51 ·
oops you're right sorry. it's there(here ) now.

the weird pipelining issue seems to only occur when the network.http.max-persistent-connections-per-server is less than 5, it doesn't break but it timeouts for a while. i'm not sure what it's doing.
 

· Cat God
Joined
·
17,238 Posts
Well this version does eventually download all the expires info, but it takes a while. Also the way it is coded, it will just keep hammering the TiVo's web server until the response comes back. I don't know how well TiVo can handle something like that. I don't think the TiVo was really designed to handle multiple requests at once especially since it seems to take a second or two to process each request.

I still think a better way of doing this would be to limit the amount of actual request that the code makes to one or two at a time. That way it will work no matter how the user set up Firefox. I do use pipelining, though my per server setting is set to 8.

I took your code, and added the code to make multiple requests like I normally do. This time though, instead of sending out one request at a time for the expires info, I changed the code to send out 2 requests at a time. It seems to work very well. I had to revert some of your code from getExpDate to do so though. I did leave in the code to retry on failure though.

You can check it out here.
 

· Registered
Joined
·
28 Posts
Discussion Starter · #53 ·
morac said:
Well this version does eventually download all the expires info, but it takes a while.
the time difference seemed negligible to me - of course i only ever have 15-20 shows at any one time.

the only reason i added the expires column was to see which show would be deleted first,second and so on. as someone with only a 40gb tivo, i like to know the order of deletion for recordings (even this is problematic though, you can't change an expiration date to a date before today. so if you want something recorded today to be deleted before a bunch of shows recorded previously you have to change all the expiration dates)

for someone with a huge drive and huge number of show who doesn't ever worry about deletions, i think it best just to leave out that column. it would speed up the page load and you could still get the exp info with the show details link.
 

· Registered
Joined
·
5 Posts
I'm using Firefox on Linux (Fedora Core 3). When I load the .xhtml file, I get two warnings about unsafe scripts. If I accept both, the page title changes to "Loading..." and the status bar says "none." Nothing else happens. Any suggestions?

p.s. I'm using morac's version, since gman622's links to a "file not found" error.
 

· Registered
Joined
·
2 Posts
gman622 said:
the file extension must be .XHTML

if you save the file in IE or notepad, it will change it on you.
I can not get it to load for anything, I have made sure the extension is correct, just comes up with a blank screen in firefox and does nothing. Any other suggestions?
 

· Cat God
Joined
·
17,238 Posts
TheCat said:
I'm using Firefox on Linux (Fedora Core 3). When I load the .xhtml file, I get two warnings about unsafe scripts. If I accept both, the page title changes to "Loading..." and the status bar says "none." Nothing else happens. Any suggestions?

p.s. I'm using morac's version, since gman622's links to a "file not found" error.
You should get a number of warnings, unless you select the remember option (which is dangerous do to a bug in Firefox). Check the javascript console for errors.

On a completely different topic I see this thread got Slashdotted.
 

· Cat God
Joined
·
17,238 Posts
rog said:
Dude. You should be worried. They posted a link to your Comcast http server in the comments there. ;)
Yeah I noticed. I got an excited and :eek: feeling at the same time. :)

Fortunately the file is small, Comcast doesn't seem to have any bandwidth restrictions and, most importantly, a smaller than normal number of people read and commented on the story (probably because it was posted on Sunday).

I have a feeling though that most people who read Slashdot build their own DVRs instead of buying TiVos in which case the file is useless to them. Though there have been a fair number of TiVo posts on Slashdot recently.
 
41 - 60 of 168 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top