diff set-flac-tracknums.py @ 130:7b9795a60e59 default tip

add FLAC tracknum utility dumb piece of shit but it works
author Paper <paper@tflc.us>
date Thu, 30 Oct 2025 09:21:00 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/set-flac-tracknums.py	Thu Oct 30 09:21:00 2025 -0400
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+import glob
+import subprocess
+
+# list of Popen classes to wait on
+# this allows us to run metaflac independently on
+# a huge list of files concurrently
+processes = list()
+
+i = 1
+
+# glob the files in order
+files = glob.glob("*.flac")
+files.sort()
+for g in files:
+	processes.append(subprocess.Popen(["metaflac", "--set-tag=TRACKNUMBER=%d" % (i), g]))
+	i += 1
+
+for p in processes:
+	p.wait()