From b6a0245796794228614c092c63b51bf50970fa08 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 6 Mar 2011 16:03:13 +0100 Subject: Avoid division by zero in eventcmd example script Thanks to Richard. --- contrib/eventcmd-examples/eventcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/eventcmd-examples/eventcmd.sh b/contrib/eventcmd-examples/eventcmd.sh index 32ffa00..2c0b159 100755 --- a/contrib/eventcmd-examples/eventcmd.sh +++ b/contrib/eventcmd-examples/eventcmd.sh @@ -25,7 +25,7 @@ case "$1" in # songfinish) # # scrobble if 75% of song have been played, but only if the song hasn't # # been banned -# if [ -n "$songDuration" ] && +# if [ -n "$songDuration" ] && [ "$songDuration" -ne 0 ] && # [ $(echo "scale=4; ($songPlayed/$songDuration*100)>50" | bc) -eq 1 ] && # [ "$rating" -ne 2 ]; then # # scrobbler-helper is part of the Audio::Scrobble package at cpan -- cgit v1.2.3