INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Get list of artists or albums or genres  (Read 1542 times)

Rob L

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 469
Get list of artists or albums or genres
« on: February 18, 2004, 06:16:36 pm »

Without going into too much detail, I'm trying to write a program that unsurprisingly hooks into the library.

I can get a complete list of the files, that's obviously easy. But with my library that takes quite a while.

What I want to do is start from one of the following:
a. a list of all albums
b. a list of all artists
c. a list of all genres

Obviously I can read all the files into my own data structures and do it that way, but that's not going to speed up the initial read any. So what's the best way to pull back just the minimum information?

I can obviously call AlbumGroup on my list of files, and that certainly does speed it up massively - but is that the only way? That obviously helps a BIT with the artists too assuming that you do actually have a reasonable number of albums rather than all different files by different artists, and of course the same thing is true with genres.  But there are only going to be a small number of genres, so it seems a bit silly to have to trawl through the complete list of albums to build the list of genres. MC clearly already knows what the list of genres, the list of album names and the list of artist names, but how do I access them directly?

And then once I've done that, I want my program to be aware when the library changes, but I guess I'll just have to keep polling the library? There doesn't seem to be an interface for checking that a change has been made to the library...

Thanks for any help

Rob
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
Re:Get list of artists or albums or genres
« Reply #1 on: February 19, 2004, 01:27:09 pm »

Rob,

1) Currently, there is no faster interface then MJAutomation.
2) And, unfortunately, there is no easy way to identify when the library changes.

Nikolay
Logged

Rob L

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 469
Re:Get list of artists or albums or genres
« Reply #2 on: February 19, 2004, 05:17:50 pm »

OK, thanks for the reply. I can just work with that then - at least I know it's not just me being stupid then :-)

At least if I do AlbumGroup it only takes 1 second to read all the albums! (although actually, testing it again, it's only 15 seconds for all tracks - I'm sure it wasn't that fast before, maybe it's the later MC10 build :-)
Logged
Pages: [1]   Go Up