Remove old 'APIC' frame, because two 'APIC' may exist together with the different description.

This commit is contained in:
codezjx 2017-07-13 00:49:23 +08:00
parent 642081bb9d
commit a656c977f2
1 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,11 @@ def add_metadata_to_song(file_path, cover_path, song):
# Modify ID3 tags
id3 = ID3(file_path)
# Remove old 'APIC' frame
# Because two 'APIC' may exist together with the different description
# For more information visit: http://mutagen.readthedocs.io/en/latest/user/id3.html
if id3.getall('APIC'):
id3.delall('APIC')
# add album cover
id3.add(
APIC(