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