Rockbox mail archiveSubject: Re: ID3 database browsing
From: Björn Stenberg (bjorn_at_haxx.se)
Linus Nielsen Feltzing wrote:
The three fields artist, album and song goes a long way. I think we should start with those (while of course not designing ourselves into a corner where we can't add others).
> 2) How to design the database to allow for fast searching/browsing with
Here's a discussion starter. For the above three fields, we could use four files:
allfiles.id3db is a simple file list, one file per line. The list is un sorted.
<field>-index.id3db are index files, sorted alphabetically by field:
That takes care of finding and browsing artists, albums and songs by name. We can also connect artists to their albums and albums to their songs. We don't have connections backwards though (browsing artist and album from song), but since that data is present in the id3 tag we can just search for it.
This format is also expandable with year, genre etc using the same formula.
> 3) How to synchronize/generate the database?
Offline. No incremental magic, total remake each time (checking to see if a file's info has changed is more expensive than just adding it).
First create the list of files, then song-index album-index and artist-index in that order (since they depend on each other).
-- Björn _______________________________________________ http://cool.haxx.se/mailman/listinfo/rockbox
Page was last modified "Jan 10 2012" The Rockbox Crew