add support to pulling explicit tag. fix tags on upc. isrc(mp4 not support, use WM tags), and composor missing(possible bug in mp4box, apple documents uses @wrt which belongs to writer in mp4box doc.)

This commit is contained in:
Xie, Tianshi
2024-05-16 16:18:38 -04:00
parent ad8f567572
commit 117a08ee4f
5 changed files with 14 additions and 4 deletions

View File

@@ -41,6 +41,12 @@ class SongMetadata(BaseModel):
lrc = ttml_convent_to_lrc(value)
tags.append(f"{key}={lrc}")
continue
if key.lower() in ('upc', 'isrc'):
tags.append(f"WM/{key.lower()}={value}")
continue
if key == 'composer':
tags.append(f"writer={value}")
continue
tags.append(f"{key}={value}")
return ":".join(tags)
@@ -55,7 +61,8 @@ class SongMetadata(BaseModel):
copyright=song_data.relationships.albums.data[0].attributes.copyright,
record_company=song_data.relationships.albums.data[0].attributes.recordLabel,
upc=song_data.relationships.albums.data[0].attributes.upc,
isrc=song_data.attributes.isrc
isrc=song_data.attributes.isrc,
rtng=1 if song_data.attributes.contentRating and song_data.attributes.contentRating == 'explicit' else 0
)
def set_lyrics(self, lyrics: str):