# HG changeset patch # User Brian Neal # Date 1647194977 18000 # Node ID ce5a5c9cd9d813498edd562e7f00eafa5e752aaa # Parent 83dd2db291f77f09906d93843d1a690604b3dc80 Tweaks to MP3 comp tool diff -r 83dd2db291f7 -r ce5a5c9cd9d8 tools/sg101mp3comptool.py --- a/tools/sg101mp3comptool.py Mon Dec 27 19:35:53 2021 -0600 +++ b/tools/sg101mp3comptool.py Sun Mar 13 13:09:37 2022 -0500 @@ -15,6 +15,7 @@ def process_mp3(mp3, args): title = mp3['fields']['title'] + print(f'Processing {title}...') m = TITLE_RE.match(title) track_num = int(m[1]) artist = m[2].strip() @@ -23,6 +24,8 @@ filepath = os.path.join(args.mp3_dir, filename) mp3file = eyed3.load(filepath) + if mp3file.tag is None: + mp3file.tag = eyed3.id3.tag.Tag() mp3file.tag.clear() mp3file.tag.title = title mp3file.tag.artist = artist