INTERACT FORUM
Windows => Plug-in Development => Topic started by: cncb 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).
-
Anyone? Is this not possible with the automation API?
-
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.
-
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.
-
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. ;)
-
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.