PDA

View Full Version : request for CLI help



totoro
2009-01-11, 11:43
Hi--

I'm trying to load up all my genre->artist, genre->album, and artist<->album mappings in order to write a browsing client with very low latency.

To start, I tried loading up all of the artists, albums, and genres using, eg

genres to get the count then genres 0 <count> to get all of them.

I thought that then I would just iterate all artists to get the artist album mapping, but the concept of "artist" seems to include composers plus orchestra conductor and album artist[/genre]in it. So I thought I would try doing

albums 0 <count> tags:al

This gives me a list of albums and artists (not artist ids, interestingly). But then when I went to go through and map back into my pre-loaded list of artists, I found that I was getting album artists that were not coming back at all in my list of artists. There obviously is some way to map from, eg, genre->artist->album, since both slimserver and moose do this.
I haven't been able to figure this out though.

Is there some documentation somewhere that explains this, or could someone explain it to me? I had a similar problem trying to figure out the db: it wasn't at all clear to me how I would figure out who were performers and who were composers, for instance (there is a role column in the contributor_track table, but no role table or anything else I could see which defined the meanings for these integer values: they're obviously ids, but I'm guessing the definitions of them are in the code or configuration or something).

Any pointers to some documentation for doing the artist->album mapping, or a place in the code where it's being done would be greatly appreciated.

Thanks for any help.

[edit]
By playing in the db, I've been able to ascertain that the following roles have the following meanings
1 performer
2 composer
3 conductor
4 album artist

Since a. there are probably others defined in the code, and b. this could clearly change at any update of the code, I don't want to rely on this.



Looking at the doc for the songinfo command, I see that I can get the roles from a track: is the intended usage here to get the representative track using the j tag on the album, and then get things like artist from this?

Seems like an awful lot of trouble vs doing a couple joins in the db.

Also, for some reason, on my box (p4 2.8 single core 3 g ram 32 bit windows xp, hitting localhost), doing albums 0 1464 tags:al takes something on the order of _15 seconds_, so clearly this wasn't meant for how I'm trying to use it.

If I do it all in sql, I can get all the relations I need in 3 queries, one to get genres, one to get genresxalbumsx(perfomer|albumartist), and a third to get timestamps and urls. This is still kind of slow, at 2.5 sec (the last one is a killer, maybe because the urls for the artwork are blobs, and this is all "programmer's sql", with the most naive possible joins, I'm sure).

Do these look like the sorts of times people would expect? Or do you think I have a faulty installation or something?