Skip to content

Commit 8057a9c

Browse files
committed
Updated logic and simplified final output
1 parent e0b5235 commit 8057a9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/mac-player.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,16 @@ main() {
256256
local full_track
257257
full_track=$(trackStatus "$PAUSE_ICON" "$PLAY_ICON")
258258

259-
if [ "$SCROLL" = "false" ]; then
259+
if [ "$SCROLL" = "true" ] && [ "${#str}" -ge $MAX_LENGTH ]; then
260+
echo "$full_track" > "$cache_file"
261+
else
260262
sliceTrack "$full_track" "$MAX_LENGTH" > "$cache_file"
261263
fi
262264
fi
263265

264266
# Allow scrolling
265267
local str=$(cat "$cache_file")
266-
if [ "$SCROLL" = "true" ] && [ "${#str}" -ge $MAX_LENGTH ]; then
268+
if [ "$SCROLL" = "true" ]; then
267269
scroll "$str" "$MAX_LENGTH" "$SCROLL_SPEED"
268270
else
269271
echo "$str"

0 commit comments

Comments
 (0)