Comment 16 for bug 1377655

Revision history for this message
Peter Levi (peterlevi) wrote :

PheniX, thanks for the effort again. Yes, such an abstraction is possible, but I think this level of abstraction is not general enough to be of much use. To see what I mean - try finding another website apart from Wallhaven for which this downloader would work with only modifying the CSS selectors. Basically there are usually some differences that would break this approach - search might be missing, with list of "Categories" present instead; search might be paged in different ways, and a count may or may not be present; The levels of indirection till one reaches the actual image from the search page might be different, etc. Purity, tags, etc. are entirely specific to Wallbase - other sites may not even have these concepts or they will be extracted in a very different manner (e.g. check the WallpapersNetDownloader).

Now, I totally agree that the image downloading functionality should be abstracted and made pluginnable, and this is in the queue, but most of the work is actually not on the Downloaders level - they can easily become interfaces along the lines of validate_query(), fill_queue(), download_one(), etc. Most of the work is abstracting out the GUI for adding/editing new image sources - e.g. Flickr and Wallbase currently use different GUIs to add a new image source, and while Wallbase and Wallpapers.net have something in common - that you specify a single URL (or a query in the case of Wallbase), we still want the proper specific description to what is expected.

Basically I'm putting off this refactoring for two reasons - there is at the moment quite a lot of dynamics there as I'm preparing the Beta version which has a serverside part, and everything related to image sources is subject to change because of this, so no use to go into refactoring it before the serverside is more stable. The second is that up till now there was not that much interest from other developers to start contributing to Variety, so this task was somewhat low in the priority list, but you are proof this is changing :-)