disk-indexer ------------ Server to index disks. Environment -d path Path to database. Start Server All known disks will be (re)scanned and updated to reflect their current collection of music files. indexer-cmd ----------- Send commands to disk indexer. check Perform some consistency checks on the database. shuffle (re)create the shuffle playlist. add uuid path Add a new disk or rescan an existing disk. quit Tell the server to shut down. disk-util --------- Environment & Object Selectors -d path Path to database. -f fid File ID -d diskid Disk ID -s seq Sequence Number Commands shuffle Shuffle all files to the 'shuffle' playlist file-dump noop files Dump files lists Show list names disks Show disk names Design Thoughts -------------- Overall playlist behaviour? - priority is - play now file - jukebox playlist (add to playing) - requested playlist - default playlist - junk playlist - or junk flag? System playlists * default / all:shuffle All tracks, (shuffled?). The default playlist. * queue User selected tracks, in order. * junk The junk list, for later operations * user list A user playlist Playing State The play state is stored for each list. There should be only one (if any) with the 'state' value non-zero. ISSUE: How to resolve a user-selected playlist if that is active since everything else is pre-known. Operations on Search * Play Now Adds to the play queue and switches to it it isn't started. * Add to List Add to specified playlist. Operations on Coming Up * Play Now Jumps to track * Junk Add to junk list (or should it be explicit?) * Remove (user playlist, queue) Remove from playlist internals --------- Database implemented in lmdb using ez-blob for serialisation. pseudo-SQL equivalent. All primary keys are 'auto increment start=1'. create table disk ( id int rimary key, uuid text unique, label text, type text mount text ) create table file ( id int primary key, diskid int not null references disk(id), size bigint, mtime bigint, duration bigint, path text unique, dir text, title text, artist text, ) create index file_by_title on file(dir); create index file_by_title on file(title); create index file_by_title on file(artist); create table list ( id int primary key, int size, name text unique, desc text ) create table file_by_list ( listid int not null references list(id), seq int not null, fileid int not null, unique (listid, seq) ) create table list_by_file ( fileid int not null references file(id), listid int not null references list(id), seq int not null, unique (listid, seq) )