jptgdp: Add a download-only flag, rename

This commit is contained in:
Salt 2019-06-13 07:37:02 -05:00
parent d2a3671f2d
commit 16ffe95285

View File

@ -1,6 +1,6 @@
#! /bin/bash
#
# justplayit
# jptgdp - Just Play the Goddamn Playlist
# Copyright (C) 2019 Vintage Salt <rehashedsalt@cock.li>
#
# Distributed under terms of the MIT license.
@ -58,6 +58,7 @@ Usage: $_name [OPTION]
Use youtube-dl and audacious to queue up a playlist given a file of only search
queries.
-c Clears the cache (which can become quite large)
-d Download only; don't queue anything up
-f <file> The playlist file to load
-r <directory> Start up rofi, if installed, and present a listing of
all .ytp files in the given directory
@ -95,7 +96,7 @@ playlist() {
wait
mv "$_tmpfile"* "$filename"
fi
audacious -e "$filename"
[ -z "$_optdownloadonly" ] && audacious -e "$filename"
done < <(if [ -n "$_optshuffle" ]; then shuf "$1"; else cat "$1"; fi)
log "Finished building queue"
}
@ -109,12 +110,15 @@ main() {
trap trapexit EXIT
# Actual program stuff
while getopts ":cf:r:sh" opt; do
while getopts ":cdf:r:sh" opt; do
case $opt in
c)
clearcache
exit $?
;;
d)
_optdownloadonly=1
;;
f)
_optfile="$OPTARG"
;;