diff --git a/randomvideo.sh b/randomvideo.sh index 9db0254..16c64bc 100755 --- a/randomvideo.sh +++ b/randomvideo.sh @@ -30,5 +30,11 @@ fi while true; do file="$(find "$folder" -maxdepth 1 -type f |sort -R |head -n1)" + + while [ "$file" == "$oldfile" ]; do + file="$(find "$folder" -maxdepth 1 -type f |sort -R |head -n1)" + done + + oldfile="$file" $player $playerparam $file done