view set-flac-tracknums.py @ 133:0d8eabdd12ab default tip

create: write H:MM:SS timestamps, add option to fill with gaussian-blur instead of black many albums are longer than one hour so writing H:MM:SS is a necessity. if anything there will just be verbose info that isn't important for my use-case. however the gaussian-blur is simply broken. It works, and it plays locally just fine, but YouTube in particular elongates the video to fit the full width. I'm not entirely sure why it does this, but it makes it useless and ugly.
author Paper <paper@tflc.us>
date Sat, 03 Jan 2026 20:25:38 -0500
parents 7b9795a60e59
children
line wrap: on
line source

#!/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()