Extend whipper's tagging ability

Add PERFORMER & COMPOSER metadata tags to audio tracks (if available).
Composer(s) and performer(s) will be extracted from MusicBrainz
recording metadata by new _getComposers and _getPerformers
functions then there will be new properties added to each track
metadata. If those data are present it will be tagged as new tags
PERFORMER and COMPOSER.

Signed-off-by: ABCbum <kimlong221002@gmail.com>
Co-authored-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
ABCbum
2020-01-15 13:13:53 +07:00
parent 150f0d5e91
commit 5cd96da6cb
2 changed files with 67 additions and 8 deletions

View File

@@ -416,6 +416,8 @@ class Program:
mbidTrack = track.mbid
mbidTrackArtist = track.mbidArtist
mbidWorks = track.mbidWorks
composers = track.composers
performers = track.performers
except IndexError as e:
logger.error('no track %d found, %r', number, e)
raise
@@ -449,6 +451,10 @@ class Program:
tags['MUSICBRAINZ_ALBUMARTISTID'] = mbidReleaseArtist
if len(mbidWorks) > 0:
tags['MUSICBRAINZ_WORKID'] = mbidWorks
if len(composers) > 0:
tags['COMPOSER'] = composers
if len(performers) > 0:
tags['PERFORMER'] = performers
# TODO/FIXME: ISRC tag