Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: ID3 database browsing
From: Björn Stenberg (bjorn_at_haxx.se)
Date: 2004-10-13


Linus Nielsen Feltzing wrote:
> 1) What do we want in the ID3 browser? I mean, which fields do we
> support? How do we want to search?

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
> as little memory usage as possible? We can waste quite a lot of disk
> space, but not that much RAM.

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:

song-index.id3db:
<allfiles offset1>;<song name1>
<allfiles offset2>;<song name2>

album-index.id3db:
<song-index offset1>;<song-index offset2>;<album name1>
<song-index offset1>;<song-index offset2>;<album name2>

artist-index.id3db:
<album-index offset1>;<album-index offset2>;<artist name1>
<album-index offset1>;<album-index offset2>;<artist name2>

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).

Comments?

-- 
Björn
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa