QUOTE(Jimmy_Neuron @ May 15 2008, 22:12)

Is there some doc on the API of the scripts?
I'm afraid this whole project is shamefully lacking in any sort of proper documentation. The best way to start a script is to copy an existing one and modify it - I'd recommend the AlbumArtExchange.boo as the best one to start from, as it uses the new strongly-typed script API.
In summary, to create a script you need to create a class that inherits from the
AlbumArtDownloader.Scripts.IScript interface. This interface defines 3 string members:
Author,
Name, and
Version, for information, and two methods:
Search and
RetrieveFullSizeImage for performing the actual search.
The
Search method is where the main body of work for a script is done, it is here that you should retrieve your results. Apart from the artist and album names to search for, a
results object implementing the
IScriptResults interface is also provided as a parameter. This is used to communicate the results of the search back to the main application.
Once you know how many results you are likely to return, set the
results.EstimatedCount property. This allows the progress bar to show an estimate of progress, rather than the indeterminate state. This property can be updated at any time if your estimate changes, so even if the exact count is not known until further pages have been downloaded and parsed, but a rough estimate can be provided quickly, it's usually best to start with a rough estimate as soon as possible and refine it later.
Apart from that, there is the
results.Add method. This should be called for each result that you want to return. The first parameter is the thumbnail image for the result. This can be an actual
Bitmap, or a
Stream containing image data, or a
Uri pointing to an image, or a
String containing the image uri. The second parameter is the name of the result.
After that, there are some optional parameters.
infoUri (
String) may be used to provide a link to a web page with more information on the result (like the Amazon and Google Image scripts do).
A width and height of the full-size image may be provided, if known, as
Int32. If at all possible, try to include these, as the size of the image is a really useful thing to know before having to actually download it.
The last parameter is not optional, and may contain whatever data you choose. If the full sized image for this result is requested, then the
RetrieveFullSizeImage method will be called on your class, and the parameter passed to it will be that data. You can then use it to obtain a full sized image for the result, and return it. Usually, this data is the uri for the full sized image, and the
RetrieveFullSizeImage method just returns it directly.
The return value of
RetrieveFullSizeImage can be any of the types that are allowed for the thumbnail image:
Bitmap,
Stream,
Uri, or
String.
Scripts are typically written in Boo, and are compiled automatically. Alternatively, any compiled .net dll in the Scripts folder containing classes implementing
AlbumArtDownloader.Scripts.IScript will also be loaded. This can be helpful for debugging scripts.
I hope this explains things sufficiently, but if you have any further questions about it, please ask.
Thanks,
Alex