Aubin Paul wrote:
> On Wed, Jan 14, 2004 at 05:41:59PM +0100, Dirk Meyer wrote:
>> No, since both don't have infos. They only create items which know how
>> to get the info for themself (item.py:Item.set_url).
>> 
>> So we need a way to get informations about playlists/directories
>> _without_ scanning all files in it during runtime.
>> 
>> And now we are back to the 'store metadata for items' idea :-)
>
> Storing the data is perfectly reasonable, but conceptually, we need to
> store "directory" properties somehow, whether in mmpython or in a db,
> but we need to treat directories as things with properties as well. 

Yes, we need to store stuff for each item. An item is a file or a
directory. 

> It'll be marginally faster using SQL because you could do a "SELECT
> sum(length) FROM mmpython WHERE path='mypath'" for a directory, 

Yes, more like every item has a parent. Each item has a unique id. So
when you enter a directory, you get (in bad sql syntax)

SELECT item WHERE parent=dir_id

to get all items _inside_ this directory. This doesn't include the
current dir, but all subdirs. That are all items we want to create
now. Next, store the result in a dict. By creating the the items, we
use that dict to do so to avoid too much sql traffic.

After entering the dir (or calling freevo cache), we store some new
infos we have right now back to the database. E.g.:

entering foo, there is a subdir bar, no infos about it. Entering bar,
will create all items in bar and freevo will store some infos about
bar back in the db. After a new start of freevo, entering foo again,
we have infos about bar: show it. 

Good about that is also that we can store infos from fxd files in
it. We will only check if the timestamp of the folder.fxd has changed
and if not, we won't parse the file again.

> I mean, as it stands mmpython seems to store a single file for a
> directory, so adding one extra line to those with the directory
> summary wouldn't be too difficult?

Yes and no. If mmpython parses bar, we want the infosmation about the
dir in the foo mmpython cache to avoid reading all mmpython files from
the subdirs.


Dischi

-- 
If you receive something that says 'Send this to everyone you know,'
pretend you don't know me. (Roy Johnson)


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to