Hi,
Looked through the documentation and found example code. Based on those I came up with a script that should have worked for me. However, when I run my resulting code I end up with no metadata, which ultimately results in cmus not sorting my songs in the right place :(.
As such I could use some extra eyes to tell me where I am going astray.
""""
from mutagen.easyid3 import EasyID3
# A bunch of code that figures out track number artist, song and album based on my own naming convention
mp3 = EasyID3(f)
mp3['album'] = album
mp3['albumartist'] = artist
mp3['artist'] = artist
mp3['title'] = title
mp3['tracknumber'] = track
mp3.save()
""""
But then when I run id3v2 on a file modified with the code above I end up with:
No ID3 tag
I inserted some debug print statements into the code and the output below shows that I have values I expect:
Working for: t61_All_Guns_Blazing.mp3
album: Metalogy
artist: Judas Priest
title: All Guns Blazing
track: 61
meaning
f='t61_All_Guns_Blazing.mp3'
album='Metalogy'
artist='Judas Priest'
title='All Guns Blazing'
track=61
So everything I am setting into the dictionary is what I expect. But
-> id3v2 -l Judas_Priest/Metalogy/t61_All_Guns_Blazing.mp3
Judas_Priest/Metalogy/t61_All_Guns_Blazing.mp3: No ID3 tag
In order for cmus to work I need to have Title, Album, Artist and the track as in the following example:
-> id3v2 -l Judas_Priest/t01_Never_Satisfied.mp3
id3v1 tag info for Judas_Priest/t01_Never_Satisfied.mp3:
Title : Never Satisfied Artist: Judas Priest
Album : Metalogy Year: , Genre: Unknown (255)
Comment: Track: 1
Judas_Priest/t01_Never_Satisfied.mp3: No ID3v2 tag
I tried the EasyTag UI but it generates the extended tags and cmus does not like those.
Help getting the simple tags into the metadata is much appreciated.
Thanks,
Robert