Retrieving info from thetvdb.com

primüs

10-02-2009 23:27:55

Hiya, 3rd thread for the night, after this i will stop harrasing!

I dont do as much desktop applications other then in Java, so not entirely sure how you are calling thetvdb.com's API, but from the 'sounds' of it (and i say this because of the definitive click noises), the My Shows tab uses an instance of Internet Explorer to retrieve its info. Now i dont know about others, but Internet Explorer has always been annoyingly slow, so my suggestion is maybe a port to something like firefox, or better yet chrome (optional of course) to perhaps speed this up?! Although i would think there would be XML libs to be able to speak HTTP direct and not have to go into a browser instance to do it, i do this a lot in java with bank API's, but as said i may not know what needs to be done =)

/suggestion.

sstteevvee

11-02-2009 00:00:14

Thoughts and suggestions are always welcome. :)

That "click" is indeed evidence of IE. It's used for the "Web Browser Control" that I use to display the episode guide on the "My Shows" tab. It's all generated and stored locally, so the browser is just going to a file:// URL. The pictures (banner at the top, and episode still frames if you have them turned on) are retrieved directly from thetvdb, though. For them you're at the mercy of IE's caching.

When I (soon) get XBMC .nfo, banner, and thumbnail support going, I'll be downloading the pictures myself, so I can then use the local copies in the episode guides, falling back the over-the-web if they're not there.

Actual downloading of the show/season/episode data is through URLs fetching XML from thetvdb's API server (ZIPped which makes it often 80% smaller). This is currently handled by .NET's WebClient class, which I think eventually maps onto whatever IE uses (or at least it shares the proxy settings and does do caching).

I download show/episode data one at a time, so an obvious improvement would be to do a (configurable) number in parallel. (an idea which just I've added to the ever-growing to-do list). I'm not sure that changing this to any other web-fetching engine (wget, curl, firefox, chrome, etc.) would make it significantly faster. Parallelisation (however you spell it) would be the way to go.

If there are alternatives to the WebClient or HTTPWebRequest class out there then I could give them a try. (.NET 2.0, in C# or C++, without annoying licensing restrictions).

primüs

11-02-2009 00:23:30

Interesting, i look forward to the update to see if it improves, just makes changing between overviews/seasons dreadfully slow at the moment, like a good 2-3 seconds wait time on click.

http://msdn.microsoft.com/en-us/library ... quest.aspx

From what i read (note: not my primary language so might not understand right) this does its own web-fetching engine, not based on another such as IE or anything. Not sure on licensing, but sounds like your getting it pretty well sorted in soon to come updates will see how speed improves. Maybe i should just kick my computer in the guts and make it load iexplore threads faster.

sstteevvee

11-02-2009 23:21:32

Changing between the overview and seasons should be pretty much "instant", even if the pictures come in a bit later. Once you've visited a season, revisiting it will get the pictures out of cache. For example, switching to a pre-visited season with pictures on takes less than half a second for me, including the episode framegrabs loading.

How many shows do you have? (Help->Statistics). Perhaps I need more than the 50 shows I have to see any delays. I assume you're running on a fairly recent computer, not a 486 :)

sstteevvee

15-02-2009 18:44:51

The latest alpha now does parallel downloads, if you want to give it a try.

sstteevvee

20-03-2009 14:28:15

I've found a thingy that will let me use firefox as the embedded web browser, rather than the current IE-based one. The catch is either (a) you have to have firefox installed on your system, or (b) the tvrename download will get 8 meg bigger, to include the firefox runtime.

I might be able to do something smart, like automatically choose IE or firefox, depending on which are installed.

It's something I'm yet to actually try, just an update on what I've found. :)