recordings

This commit is contained in:
2025-07-31 08:55:25 +02:00
parent 64afff2110
commit 7eb9d6633f
4 changed files with 81 additions and 1 deletions

32
src/awk/recordings.awk Normal file
View File

@@ -0,0 +1,32 @@
BEGIN { OFS="\t" }
{
gsub("&", "\\\\&")
id = $1
med = $2
nr = $3
dur = $4
title = $5
artist = $6
# Parse duration
if (dur) {
dur = int(dur / 1000)
dh = int(dur / 3600)
dur = dur % 3600
dm = int(dur / 60)
ds = dur % 60
if (ds <= 9)
ds = "0"ds
dur = dh ? dh":"dm":"ds : dm":"ds
} else {
dur = "??:??"
}
line = format
sub("<<med>>", med, line)
sub("<<nr>>", nr, line)
sub("<<title>>", title, line)
sub("<<artist>>", artist, line)
sub("<<duration>>", dur, line)
sortk = med" "nr
print sortk, line, id
}