Rewrite track metadata cache
Store track metadata in one file (~/.cmus/cache) instead of two files
(data and index). All data is converted to struct track_info and put
into a hash table. This may sound like wasting memory but 582878 is not
that much when compared to size of the old index file (256561) which was
kept in memory.
Old sizes for 3263 tracks:
327806 trackdb.dat
256561 trackdb.idx
584367 total
New size:
582878 cache
This new cache consumes less memory if all tracks are in playlist
because there's no .idx data (filenames, offsets and sizes) in memory
anymore.
The new code is faster because data is read at once, not in small pieces
like the old code did. Track metadata is hashed by filename so the
lookups should be much faster than in the old code which did binary
search over the index and then read data from the .dat file.
13 files changed: