From 1b32a72a0ab18171c056ed3ca35d2e5a2464a55a Mon Sep 17 00:00:00 2001 From: Salt Date: Fri, 27 Sep 2019 16:26:44 -0500 Subject: [PATCH] Add total line statistics for debugging --- ptgdp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ptgdp b/ptgdp index f383071..ea30cab 100755 --- a/ptgdp +++ b/ptgdp @@ -276,12 +276,15 @@ playlist() { local -i dlcache=0 local -i dlsuccess=0 local -i dlerr=0 - local -i maxlines=0 + local -i goodlines=0 + local -i totallines=0 while read line; do + totallines+=1 validateline "$line" || continue - maxlines+=1 + goodlines+=1 done < "$1" - log "Parsed playlist \"$1\" with $maxlines songs" + log "Parsed playlist \"$1\" with $goodlines songs" + log "Playlist has $totallines total lines" 2 while read line; do if validateline "$line"; then queuesong "$line" || error "Failed to enqueue song: \"$line\""