[maemo-developers] What's wrong with folder browsing?

From: Frantisek Dufka dufkaf at seznam.cz
Date: Tue May 22 17:33:06 EEST 2007
Gustavo Sverzut Barbieri wrote:
> I don't like the "timer" thing, but yes, it can help and I've already
> considered it.
> As for reboot, remember that on reboot, it's not re-parsed (files are
> not opened), just re-scanned (stat and compare mtimes). We must do
> this stat in order to check for files that changed elsewhere.

Not sure how Canola works. Maybe metalayer-crawler does it. We don't 
have sources, right? For both we can only guess what you guys do in the 

> keep db in mmc is problematic, since users want a unified view of
> every data and this requires us to merge selects from every db, either
> by creating a virtual db with data or doing that with code (our own
> virtual db). That creates more problems than it saves.

Maybe. Don't know implementation. I just know that if some media is not 
accessible there is no point of keeping the metadata so having them 
together with data seems to make sense. Even if it is moderately complex 
  it may be worth the effort since it seems like the right thing (to 
have more metadata databases). This may even allow you to share the 
index with some desktop application when you use the card with usb 
reader and even create index on PC to save tablet power (which is how 
itunes may work).

>> You can also do MD5 sum of directory listing (even output of ls -R or
>> -lR) and do not scan files at all if listing hash is same.
> this is easy, but not much faster than the stats... 

Sure if you stat directories recursively it is same. The idea was just 
to avoid reading the file data as much as possible.  At least 
metalayerc-crawler seems to be very dumb at this and recreates whole 
database (haven't seen sources but it takes ages and does a lot of write 
i/o after reboot or card reinsert whne there is no change in data on the 

Another hint could be to check free available space, if it is same like 
before it is unlikely there was some change and even recursive scan can 
be skipped.

> and you still may
> have inconsistencies, imagine you noticed incorrect id3 and then you
> plugged in your device using USB cable (your media get unmounted), use
> some app on your pc to fix those incorrect id3 and then remove the
> cable, you want your data to be updated.

I think you (not just Canola, metalayer-crawler too) are penalizing user 
for many scenarios that are very unlikely causing the most frequent use 
case to be slow up to the point of being unusable. In such unlikely 
situation user should always have option to manually do the rescan from 
control panel applet (possibly also with selecting subtree with the change).

So the idea is not to have perfect implementation but fast one solving 
most frequent cases (1. no change, 2. just files added/removed) with 
possibility to do manual rescan.

There could be even some slider in control panel applet with 
fast-slower-accurate choice.

> I hope in future we can just use device-wide db and do no scanning at
> all. If metalayer-crawler export its data somehow, I'd be really glad
> to remove the scanning from Canola, it no benefit having it on our
> side.

Definitely, you guys should talk together and do one best implementation :-)


More information about the maemo-developers mailing list