Mercurial > codedump
annotate 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 |
| rev | line source |
|---|---|
| 130 | 1 #!/usr/bin/env python3 |
| 2 import glob | |
| 3 import subprocess | |
| 4 | |
| 5 # list of Popen classes to wait on | |
| 6 # this allows us to run metaflac independently on | |
| 7 # a huge list of files concurrently | |
| 8 processes = list() | |
| 9 | |
| 10 i = 1 | |
| 11 | |
| 12 # glob the files in order | |
| 13 files = glob.glob("*.flac") | |
| 14 files.sort() | |
| 15 for g in files: | |
| 16 processes.append(subprocess.Popen(["metaflac", "--set-tag=TRACKNUMBER=%d" % (i), g])) | |
| 17 i += 1 | |
| 18 | |
| 19 for p in processes: | |
| 20 p.wait() |
