id3guess: prompt for year

This commit is contained in:
Josh Holtrop 2012-06-03 21:28:27 -04:00
parent eeec22285a
commit 4b94a83b44

View File

@ -9,10 +9,12 @@ sys.stdout.write('Artist: ')
artist = sys.stdin.readline().strip() artist = sys.stdin.readline().strip()
sys.stdout.write('Album: ') sys.stdout.write('Album: ')
album = sys.stdin.readline().strip() album = sys.stdin.readline().strip()
sys.stdout.write('Year: ')
year = sys.stdin.readline().strip()
for f in sorted(os.listdir('.')): for f in sorted(os.listdir('.')):
m = re.match('(\d+)\s(.*)\.mp3', f, re.I) m = re.match('(\d+)\s(.*)\.mp3', f, re.I)
if m is not None: if m is not None:
track, title = m.group(1, 2) track, title = m.group(1, 2)
sys.stdout.write('%s: Track "%s", Title "%s"\n' % (f, track, title)) sys.stdout.write('%s: Track "%s", Title "%s"\n' % (f, track, title))
Popen(['id3tag', '-a', artist, '-A', album, '-t', track, '-s', title, f]).wait() Popen(['id3tag', '-a', artist, '-A', album, '-y', year, '-t', track, '-s', title, f]).wait()