skriptit/media-skriptit/bin/lsdurations.sh
Juhani Krekelä bd2729fdb7 media-skriptit
2026-08-19 23:37:23 +03:00

19 lines
380 B
Shell
Executable file

#!/bin/sh
if ! getextattr user duration-secs "$@" >/dev/null 2>&1
then
"$(dirname "$0")/../libexec/probe-media.sh" "$@"
fi
getextattr user duration-secs "$@" | awk '
BEGIN { FS="\t"; }
{
if (length($2) > 0) {
secs=int($2 + 0.5);
mins=int(secs/60);
secs=secs%60;
hours=int(mins/60);
mins=mins%60;
printf "%d:%02d:%02d %s\n", hours, mins, secs, $1;
}
}
'