2008-05-04, 09:54 PM
Ted the Penguin Wrote:Hey,
I just got around to checking out your plugin... I have not used it yet, other than the configuration parts. the scan completed, but there still seems to be a large number of requests to anidb waiting.
I scanned 978 files, and when the scan was over, there were still 650+ anidb requests waiting. I have no connection problems, do you have to throttle your requests heavily to comply with their API? There is about 30 seconds between requests.
Once I use the rest of your plugin I will let you know what I think about it.
Your guess about throttling the requests is exactly correct.
It's a cost of using the API -- part of the requirements are that I am not allowed to issue more than one API request every 30 seconds "for an extended period of time". Which makes, as you're discovering, the initial run of the scanner quite painful. Or at least quite long -- it took me three days.
Once the initial scan is done and you're just adding new items, it isn't too bad, but the first trip through. Ugh.
On the other hand, though, at least it is an actual API. I don't rely on screen scraping anywhere, they actively work to ensure that API changes will not break existing clients, and the authors of the API are willing to add additional commands and features if the current specifications don't supply the data a client needs.
So as far as trade-offs go, I think it's a good one. I get a fairly rich feed of data in a consistent format and I don't need to worry about a web page change breaking the plugin.
But yeah, that first run sure takes a long time. I've made it a bit less painful in the next version, but only a bit.