diff --git a/justplaythegoddamnpart b/jptgdp similarity index 93% rename from justplaythegoddamnpart rename to jptgdp index ed0b3de..6f80f96 100755 --- a/justplaythegoddamnpart +++ b/jptgdp @@ -1,6 +1,6 @@ #! /bin/bash # -# justplayit +# jptgdp - Just Play the Goddamn Playlist # Copyright (C) 2019 Vintage Salt # # 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 The playlist file to load -r 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" ;;