fix track tagging
This commit is contained in:
parent
f3baccf7b3
commit
198651145a
|
@ -29,6 +29,7 @@ export const writeMetadataFlac = (
|
|||
flac.setTag('LYRICS=' + track.LYRICS.LYRICS_TEXT);
|
||||
}
|
||||
|
||||
if (track.SNG_CONTRIBUTORS) {
|
||||
if (track.SNG_CONTRIBUTORS.composer) {
|
||||
flac.setTag('COMPOSER=' + track.SNG_CONTRIBUTORS.composer.join(', '));
|
||||
}
|
||||
|
@ -50,6 +51,7 @@ export const writeMetadataFlac = (
|
|||
if (track.SNG_CONTRIBUTORS.mixer) {
|
||||
flac.setTag('MIXER=' + track.SNG_CONTRIBUTORS.mixer.join(', '));
|
||||
}
|
||||
}
|
||||
|
||||
if (cover) {
|
||||
flac.importPicture(cover, dimension, 'image/jpeg');
|
||||
|
|
|
@ -42,13 +42,13 @@ export const writeMetadataMp3 = (buffer: Buffer, track: trackType, cover?: Buffe
|
|||
value: track.DURATION,
|
||||
});
|
||||
|
||||
if (track.SNG_CONTRIBUTORS) {
|
||||
if (track.SNG_CONTRIBUTORS.composer) {
|
||||
writer.setFrame('TXXX', {
|
||||
description: 'COMPOSER',
|
||||
value: track.SNG_CONTRIBUTORS.composer.join(', '),
|
||||
});
|
||||
}
|
||||
|
||||
if (track.SNG_CONTRIBUTORS.writer) {
|
||||
writer.setFrame('TXXX', {
|
||||
description: 'LYRICIST',
|
||||
|
@ -67,6 +67,7 @@ export const writeMetadataMp3 = (buffer: Buffer, track: trackType, cover?: Buffe
|
|||
value: track.SNG_CONTRIBUTORS.producer.concat(track.SNG_CONTRIBUTORS.engineer).join(', '),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (track.LYRICS) {
|
||||
writer.setFrame('USLT', {
|
||||
|
|
|
@ -44,7 +44,7 @@ interface songType {
|
|||
SMARTRADIO: string; // 0
|
||||
SNG_ID: string; // '3135556'
|
||||
SNG_TITLE: string; // 'Harder, Better, Faster, Stronger'
|
||||
SNG_CONTRIBUTORS: {
|
||||
SNG_CONTRIBUTORS?: {
|
||||
main_artist: string[]; //['Daft Punk']
|
||||
author?: string[]; // ['Edwin Birdsong', 'Guy-Manuel de Homem-Christo', 'Thomas Bangalter']
|
||||
composer?: string[];
|
||||
|
|
Loading…
Reference in New Issue