From e79fc9f18f074fcdc95343dbf36787f0a0779f56 Mon Sep 17 00:00:00 2001 From: elena Date: Tue, 12 Sep 2017 17:06:43 +0300 Subject: [PATCH] fixed scrolling text breaking when title contained slashes --- Scripts/music.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Scripts/music.sh b/Scripts/music.sh index a1068bc..bcadb30 100755 --- a/Scripts/music.sh +++ b/Scripts/music.sh @@ -18,11 +18,12 @@ # (where 12 is the offset (zero-based) and 5 is the length) # Limit for scrolling text -LIMIT=26 +LIMIT=30 #SEPERATOR=" --- " #SEPERATOR=" -- " #SEPERATOR=" ~~~ " SEPERATOR=" ~~ " +#SEPERATOR="  " #SEPERATOR=" <> " SEPERATOR_LENGTH="$(echo ${#SEPERATOR})" @@ -100,8 +101,10 @@ do else LOOPTAIL="$(echo $INPUT | cut -c -$LIMIT)" - FULLSTRING="$(echo $INPUT | sed "s/$/$SEPERATOR/" | sed "s/$/$LOOPTAIL/" )" - + FULLSTRING="$(echo "$INPUT$SEPERATOR$LOOPTAIL")" + #FULLSTRING="$(echo $INPUT | sed "s/$/$SEPERATOR/" | sed "s/$/$LOOPTAIL/" )" + + # This is to prevent the bug when song changes and current i is larger than current song length # (Not needed anymore, this bug was fixed differently) # if [ $i -gt "${#FULLSTRING}" ]; then