From 1d983c0175a85d53f4b3a51f8ec8d7e92ec30b31 Mon Sep 17 00:00:00 2001 From: Nathan Lasseter Date: Sun, 6 Dec 2015 20:45:52 +0000 Subject: [manyplayer] Fixed 08 next not octal bug and added tell command --- manyplayer | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/manyplayer b/manyplayer index 982f144..5f2d7ee 100755 --- a/manyplayer +++ b/manyplayer @@ -46,11 +46,17 @@ function play_last_file { function play_next_file { local thelast=$(<${MANYPLAYER_DIR}/last) - local thenext=$(printf %02d $(($thelast + 1))) + local thenext=$(printf %02d $((10#$thelast + 1))) echo -n $thenext > ${MANYPLAYER_DIR}/last play_last_file } +function tell_last_file { + local this=$(<${MANYPLAYER_DIR}/last) + local filename=$(<${MANYPLAYER_DIR}/filename) + echo "Last: ${filename/!/$this}" +} + function setup { local guess=$(echo *$1*) local name=${guess/$1/!} @@ -77,6 +83,7 @@ Manyplayer version 0.5 Usage: next Watch next episode same Watch the last episode again + tell Print the last filename manyplayer setup Setup manyplayer for this directory manyplayer cmd Set the command for this directory manyplayer pos Set the position for this directory @@ -90,6 +97,9 @@ if [ "x$exe" == "xnext" ] ; then elif [ "x$exe" == "xsame" ] ; then check play_last_file +elif [ "x$exe" == "xtell" ] ; then + check + tell_last_file elif [ "x$exe" == "xmanyplayer" ] ; then if [ "x$1" == "xsetup" ] ; then if [ "x$2" == "x" ] ; then -- cgit v1.2.3