summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-09-01 03:18:08 +0200
committerRasmus Steinke <rasi@xssn.at>2015-09-01 03:18:08 +0200
commitd731468c1841b3f43eeb98f2e3d8fb49de3bfea5 (patch)
tree98716726177bf2170a8c52aaabe684ebf4b91552 /clerk
parente811f9190bf95023158f2db2d5b3856b199bb574 (diff)
downloadperl-app-clerk-d731468c1841b3f43eeb98f2e3d8fb49de3bfea5.tar.gz
perl-app-clerk-d731468c1841b3f43eeb98f2e3d8fb49de3bfea5.tar.xz
fix deletion code in playlist
Diffstat (limited to 'clerk')
-rwxr-xr-xclerk17
1 files changed, 13 insertions, 4 deletions
diff --git a/clerk b/clerk
index b559237..147aeb8 100755
--- a/clerk
+++ b/clerk
@@ -581,11 +581,19 @@ resumePlaylist () {
# Play or delete items from current Queue
dplayQueue () {
while true; do
- re='^[0-9]+$'
- if [[ "$POS" =~ $re ]]; then
- POS=$(( $POS + 6 ))
+ if [[ -z $POS ]]; then
+ re='^[0-9]+$'
+ if [[ "$POS" =~ $re ]]; then
+ POS=$(echo $(( $POS + 2 )))
+ else
+ POS=0
+ fi
else
- POS=0
+ if [[ $last != $(mpc -f '%file%' playlist | tail -1) ]]; then
+ POS=$(echo $(( $POS + 5 )))
+ else
+ POS=$(echo $(( $POS + 6 )))
+ fi
fi
select="-selected-row $POS"
@@ -614,6 +622,7 @@ TRACKDISPLAY=$(echo -e "< Return\n---\nLoad Playlist\nLoad RSS\nSave Playlist\n-
POS=$(echo "${TRACKDISPLAY}" | awk '{ print $1 }')
if [[ $val -eq 10 ]]; then
+ last=$(mpc playlist -f '%file%' | tail -1)
mpc del $POS;
POS=$(( $POS - 1));
dplayQueue