# - Prompts the user whether to use the cached data or regenerate it.
# - Uses an EDL file to specify the starting offset for the first file.
# Usage: rand_media_pl.sh [DIR]
-# Version: 0.0.5
-# Dependencies: Bash 4, ffprobe, mpv, bc, shuf
+# Version: 0.1.0
+# Dependencies: Bash 4, ffprobe, mpv, bc, shuf, GNU Parallel
yell() { echo "$0: $*" >&2; } # Print script path and all args to stderr
die() { yell "$*"; exit 111; } # Same as yell() but exits with code 111
else
yell "WARNING: Invalid duration '$duration' for file '$file', skipping." 1>&2;
fi;
- done < <(find_media_files | sort; );
+ done < <(find_media_files | parallel readlink -f '{}' | sort -u; );
total_duration_s="$(printf "%.1f" "$total_duration"; )";
total_duration_h="$(echo "scale=1; $total_duration / 3600" | bc -l; )";