ptgdp: Figure out how many songs we need to grab
This commit is contained in:
parent
83a32b0090
commit
afcb98e06b
20
ptgdp
20
ptgdp
@ -226,12 +226,26 @@ playlist() {
|
|||||||
local -i dlexist=0
|
local -i dlexist=0
|
||||||
local -i dlsuccess=0
|
local -i dlsuccess=0
|
||||||
local -i dlfailure=0
|
local -i dlfailure=0
|
||||||
|
local -i maxlines=0
|
||||||
while read line; do
|
while read line; do
|
||||||
[ -z "$line" ] && continue
|
# Strictly speaking, this removes all whitespace from the line
|
||||||
# Ignore comment lines
|
# While not *exactly* what I'm looking for, it's sufficient for trimming whitespace lines
|
||||||
if ! [ "${line#\#}" = "$line" ]; then
|
local linenows=${line//[[:space:]]}
|
||||||
|
if ! [ "${line#\#}" = "$line" ] || [ -z "$linenows" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
unset linenows
|
||||||
|
maxlines+=1
|
||||||
|
done < "$1"
|
||||||
|
log "Enqueued playlist with $maxlines lines"
|
||||||
|
while read line; do
|
||||||
|
[ -z "$line" ] && continue
|
||||||
|
# Ignore comments and blank lines
|
||||||
|
local linenows=${line//[[:space:]]}
|
||||||
|
if ! [ "${line#\#}" = "$line" ] || [ -z "$linenows" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
unset linenows
|
||||||
rm "$_tmpfile"* > /dev/null 2>&1
|
rm "$_tmpfile"* > /dev/null 2>&1
|
||||||
# Do the do
|
# Do the do
|
||||||
cachesong "$line"
|
cachesong "$line"
|
||||||
|
Loading…
Reference in New Issue
Block a user