~q3cpma/mus

352bf89c826348908148b519a5a099146a8246dc — q3cpma 9 months ago a340dcc
Fix typo in README
Export fair_shuf options in mus_album_rand
2 files changed, 12 insertions(+), 5 deletions(-)

M README
M mus_album_rand
M README => README +2 -2
@@ 7,8 7,8 @@
mus is a simple CLI client/daemon music player consuming a plaintext album
directory path playlist.

File support is limited 16 bits mono/stereo FLAC, Vorbis and Opus on GNU/Linux
and {Free,Net,Dragonfly}BSD, out of the box. It can work easily on
File support is limited to 16 bits mono/stereo FLAC, Vorbis and Opus on
GNU/Linux and {Free,Net,Dragonfly}BSD, out of the box. It can work easily on
OpenBSD and MacOS by installing a port for flock(1).
Features include gapless playback, replaygain support and event reporting, see
mus_player/TODO for stuff in the work.

M mus_album_rand => mus_album_rand +10 -3
@@ 14,7 14,7 @@ usage()
    $(basename -- "$0") - Album picker

**SYNOPSIS**
    $(basename -- "$0") [**-h**] [**-d** __FILE__] [__COUNT__]
    $(basename -- "$0") [**-h**] [**-d** __FILE__] [**-o** __FAIR_SHUF_OPTS__] [__COUNT__]

**DESCRIPTION**
    Randomly pick and output to stdout __COUNT__ albums (if no __COUNT__ is


@@ 29,6 29,9 @@ usage()
        Set the album database path. Override the \$__MUS_ALBUM_DB__ environment
        variable.

    **-o** __FAIR_SHUF_OPTS__
        Additional options passed to **fair_shuf**.

**ENVIRONMENT**
    __MUS_ALBUM_DB__
        Album database path. Defaults to


@@ 40,7 43,8 @@ EOF

album_db=${MUS_ALBUM_DB:-${XDG_CONFIG_HOME:-$HOME/.config}/mus/album_db}

while getopts "d:h" OPT
fs_opts=
while getopts "d:ho:" OPT
do
	case "$OPT" in
		d)


@@ 49,6 53,9 @@ do
		h)
			usage 0
			;;
		o)
			fs_opts=$OPTARG
			;;
		\?)
			usage 1
			;;


@@ 58,4 65,4 @@ shift $((OPTIND - 1))
[ $# -gt 1 ] && usage 1

requirefile -f "$album_db"
flock -- "$album_db" "$rpath_bin"/fair_shuf -n "${1:-1}" "$album_db"
flock -- "$album_db" "$rpath_bin"/fair_shuf -n "${1:-1}" $fs_opts "$album_db"