music collection terminal interface

Files
README.md

mcol #

mcol lets you browse an MPD release archive in a terminal.

Structure #

mcol reads recognised dated lists. Each non-empty line is a slash-separated release path:

  • artist/album
  • label/artist/release, including longer label, artist and release paths

Blank lines and parent paths are not counted as releases. mcol scans these list locations, with no date cutoff:

  • YEAR/MONTH/dailies/YYYY-MM-DD.txt, or the older DD_MM_YYYY.txt format
  • YEAR/dailies/YYYY-MM-DD.txt when no month-local daily list exists
  • YEAR/dailies/stdin_playlist_YYYYMMDD*.txt when no daily list exists
  • YEAR/MONTH/1_..._....txt to YEAR/MONTH/4_..._....txt for weekly lists

Usage #

You need Janet 1.41 or later.

jpm run tui INPUT=/path/to/releases

mcol reads --input, MCOL_INPUT and the current directory, in that order. From a checkout you can also run the script directly:

export MCOL_INPUT=/path/to/releases
bin/mcol

mcol caches the summarized report so repeat starts are fast. It stores the cache in $XDG_CACHE_HOME/mcol/report.cache, or ~/.cache/mcol/report.cache when XDG_CACHE_HOME is not set. The cache checks the archive by file count, total size and newest modification time. Use --refresh to force a full rescan and rebuild the cache. Use --no-cache to skip the cache for one run.

The demo archive is a small set of release lists to try:

jpm run tui INPUT=demo

Keys #

d  dailies      m  months      w  weeks
l  labels       a  artists     s  search
r  random view  pr random play ra randomize buffer
u  update library ua update all.txt
p  play release  q  queue release
pa play buffer   qa queue buffer
np[N] next page pp[N] prev page b  back
?  help         /  filter      x  exit

Building #

Building, testing and installing run through ninja. build and install generate doc/mcol.1 from doc/mcol.1.scd with scdoc.

ninja build                    # generate the manual (default target)
ninja test                     # fixture, demo and unit tests
ninja tui                      # run the interactive browser
INPUT=demo ninja tui           # run it against the demo archive
ninja install                  # /usr/local, uses sudo when needed
ninja uninstall                # remove installed files
ninja clean                    # remove generated files

install writes a launcher to $PREFIX/bin/mcol, the Janet modules to $PREFIX/libexec/mcol/src/mcol, and the manual to $PREFIX/share/man/man1. It uses sudo when the target directories are not writable. Set PREFIX, BINDIR, LIBEXECDIR, MANDIR, DESTDIR, SCDOC, JANET or NO_COLOR to override a default. Read mcol(1) after installation.

The same steps are available through jpm if you prefer:

jpm test
jpm run install-files
jpm run uninstall-files