INTERACT FORUM

Please login or register.

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

Author Topic: Enumerate Genres With SDK?  (Read 2422 times)

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3105
Enumerate Genres With SDK?
« on: March 11, 2008, 08:59:28 am »

Is there a way to enumerate Genres or any other field with the SDK?  That is, retrieve a list of all the used Genres in the library (like that shown in the Smartlist creation dialog, for example).
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3105
Re: Enumerate Genres With SDK?
« Reply #1 on: March 19, 2008, 08:08:22 am »

Anyone?  Is this not possible with the automation API?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Enumerate Genres With SDK?
« Reply #2 on: March 19, 2008, 09:12:31 am »

You could do it the hard way... retrieve a  FilesAutomation object containing all of the files in the library, then look at them one by one and compile your own list.

What would be really nice is if the SDK implemented an Enumerate function that took the name of a field and a FilesAutomation object and returned a list of all the values of that field in that object. The you could get a list of all the Artists, Genres, Comments, etc.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Enumerate Genres With SDK?
« Reply #3 on: March 19, 2008, 09:15:38 am »

Media Center doesn't have genre, artist, etc. tables so direct enumeration isn't possible.

One approach is to a file search with a ~nodup specifier to let it filter the list for you.
Logged
Matt Ashland, JRiver Media Center

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Enumerate Genres With SDK?
« Reply #4 on: March 19, 2008, 09:26:05 am »

One approach is to a file search with a ~nodup specifier to let it filter the list for you.

Ah, I hadn't even thought of that. That would make it pretty simple really. All that would get returned is one file each of all the genres in your library. Then you just iterate through them and compile the list.

I wish I'd thought of that (or you'd mentioned it) sooner. That could have made life a little easier.

I guess that's why Matt gets paid to do this and for me it's just a sometimes hobby. ;)
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3105
Re: Enumerate Genres With SDK?
« Reply #5 on: March 19, 2008, 09:41:58 am »

Media Center doesn't have genre, artist, etc. tables so direct enumeration isn't possible.

One approach is to a file search with a ~nodup specifier to let it filter the list for you.


Thanks, this works well.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP
Pages: [1]   Go Up