Hi
I was thinking about implementing this old request: http://code.google.com/p/ps3mediaserver/issues/detail?id=240 about serving OS X smart folders. It's a little bit similar feature as Virtual Folders, but OSX specific. I haven't really figured out yet the internals of PMS, so maybe you could point me to right direction.
Regarding how to implement it the actual feature:
The OSX smart folders are actually xml files. The xml contains a query, which is retrieved using spotlight. Even though we cannot access spotlight directly (well, there might be a way through the native API by wrapping, but let's not go there for now), there's a command line tool called mdfind, which let's us actually perform the searches. So the Smart folder xml contains the query, and with little parsing it can be retrieved and passed to mdfind. The query though needs some editing. MDfind will provide a list of file names with full path based on query string. Everything up to this should be fairly simple to implement (though is it the best way, can be discussed).
So, let's assume I get all that implemented. How does PMS actually read the files and serve them? What classes / methods I should look into? I was checking out the db and it seems the files are stored with full path, so at least for me it seems this could be implemented (in theory?). I already implemented adding the smart folders through the UI to the folders list, and I assume somewhere there is a method that will go through the folders, and add files to the db, but before I continue I'd like some feedback (and maybe some pointers to where to start and what to consider).
Ideas? Thoughts? Should I even continue? And oh, I will be adding unit tests as I progress, at least to the new code I write and to the code I change. I also added PowerMock library to make it little bit easier. https://github.com/glebb/ps3mediaserver ... artfolders
Br,
Antti
