Once upon a time, I’ve been asked
“Greg, which console command would convert track filenames of the type INTERPRET_Trackname.mp3 to Interpret – Trackname.mp3 ?”
I’ve answered with a simple python script that can be found down below. It could be easily enhanced to gather data from existing id3 tags:
#! /usr/bin/env python
import sys
import os.path
import re
def visit(arg, dirname, names):
for name in names:
sn = os.path.splitext(name)
if sn[1][1:] == 'mp3':
oldName = os.path.join(dirname, name)
p = re.compile('_')
s = p.split(name)
if len(s) > 1 and s[0].isupper():
newName = os.path.join(dirname, s[0].capitalize() + ' - ' + s[1])
os.rename(oldName, newName)
print 'File "' + oldName + '" renamed to "' + newName + '".'
if len(sys.argv) > 1:
path = sys.argv[1]
else:
path = '.'
os.path.walk(path, visit, 0)
With that amount of code one wouldn’t even have collected the filenames in C.
I currently receive a considerable number of [upstream] patches for dotProject or related fields. Unfortunately some of these important contributions cannot (at least not easily) be adopted because theyare built against outdated files or not reflecting the core product’s purposes or targets or are inconsistent with present code.
I am really willing to add your contributions, but I have one entreaty: It is always a good idea discussing the aimed changes with the responsible developers in advance. I’ll be happy to give you the necessary hints, advices and guide you through the contribution process. Thank you very much for your comprehension.