Jason Tackaberry wrote: > I created kaa/vfs and added to vfs/src/db.py a cleaned up version of > what I emailed here yesterday. See test/testdb.py for a demo. > > The main change I made to the code was removing the whole notion of > directories. Instead, everything is an object, and any object can be a > parent of any other object.
That is something I also had in mind. But for a dir, you add the whole filename and for normal files only the basename. Yes, you need the whole filename to find a dir, but it is kind of ugly, don't you think? And a dir id doesn't have to be unique. You should think of softlinks. When I have to softlinks pointing to the same dir, the have a different name (based on the softlink) but they have the same content. I also would like to add a 'root' filed in the db. This should point to the '/' dir for this file. If you have a disc, it has it's own root dir to find files in queries you actually have right now (and to move a disc between mount points). > Adding directories like I did above isn't really how we'd want to do it. > It makes sense to make full use of the parent id, so the VFS would > actually create separate objects for each element in the path (i.e. /, > home, freevo, and mp3 "dir" objects, with appropriate parent ids set). But how to find a file? To get information about /home/freevo/mp3/Artists/Name_of_artist/Name_of_Album/Name_of_file you would do too many selects just to get this information. Next question (and this isn't easy at all): how do I now the information in the db is still valid. Yes, we could use the mtime to check that. But e.g. images use bins xml files to get the data. When foo.jpg.xml changes, foo.jpg needs to be parsed again. Only kaa.metadata knows about such dependencies. And how does Freevo know? Let's say we have more than just Freevo using the same db. When this app is running and the file is updated, how does Freevo know later that the information isn't ok for Freevo? To make it more complicated: Freevo wants to give the number of items in a directory. But a fxd file can hide some video files (and even contain more than one item itself). So Freevo has to know that his information about the dir is invalid when the fxd fie changes. Or should kaa.vfs know about this? We could add the fxd parsing to kaa.metadata. And what about playlists? Should kaa.metadata parse a playlist file. It is not really a metadata, it is the data. And how do we store a playlist in the db. It would be nice to do one select to get all files for a playlist. OK, that are the questions I can remeber right now. I guess I had more but forgot them. They will come back :) Dischi -- Thunder rolled. ... It rolled a six. -- (Terry Pratchett, Guards! Guards!)
pgpPiwejWehhL.pgp
Description: PGP signature