[GSoC update] Distributed Collections: Week 1

Maximilian Kossick maximilian.kossick at googlemail.com
Sat May 29 15:01:36 CEST 2010


On Fri, May 28, 2010 at 6:16 PM, Varrun Ramani <varrunr at gmail.com> wrote:
> Distributed Collections::GSoC update
> ============================
> I did some base work first, configuring Amarok as a front end to Ampache to
> check out the features the current API offers. I also went through the
> Ampache XML API documentation[1] and looked at the provision for searching
> local collections in Amarok. Identified the main tasks to initially look
> at:-
>
> 1. Make a detailed set of requirements for the new API. Currently, to do a
> multi-level search, multiple requests have to be sent to the server. A
> solution to do the same in one single query is needed.
>
> 2. Make improvements to AmpacheServiceQueryMaker, to satisfy the new API.
>
> 1. Regarding the first part i.e making it one request, I had an idea, but i
> dont know how viable it may be. Like in LaTeX, we have the concept of
> sections, subsections, subsubsections to maintain hierarchy, we can use a
> similar concept to distinguish between levels of search in the API.
> Eg.
> Methods :-
> Level 1: artist, album, title,...
> Level 2: subartist,subalbum, subtitle, ...
> Level 3: subsubartist subalbum, .......
>
> An example request could be :
> server?genre=hiphop&subartist=eminem&subyear=2000&subsubtitle=8mile
>
> The obvious disadvantage is that only few levels can be used here
> and  number of methods increases n times where n - # of levels.
>
> 2. Also, since Amarok supports more fields than Ampache the methods
> for Playcount, Rating, Bitrate, Year and Score have to be added.
>
> [1] http://ampache.org/wiki/dev:xmlapi

Passing complex searches as http parameters is a dead end in my
opinion. A solution that is used in Amarok already is to store the
query as XML. You would then be able to post that XML to Ampache. The
classes that do that are called XmlQueryWriter and XmlQueryReader in
Amarok.

That approach is used quite successfully in Amarok's D-Bus API. There
is a D-BUS method that allows external applications to query Amarok's
collections (all collections, unlike earlier versions which had to use
SQL, and broke horribly when Amarok's SQL schema changed). Amarok
takes a XML string, and returns a list of maps continaing track
metadata.

Theoretically the XML format does already support queries for other
entities than tracks, it's just that the current D-BUS API does not
support this.

I think I've got a draft for a XSD lying around on my harddrive
somewhere. I'll try to dig it up.

Cheers,
Max


More information about the Amarok-devel mailing list