Merge pull request #258 from DanTheMan827/write-full-title
fix(downloads): write full track title to metadata
This commit is contained in:
commit
4b4d701e9f
2 changed files with 5 additions and 5 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
import { getCoverBlob } from './utils.js';
|
import { getCoverBlob, getTrackTitle } from './utils.js';
|
||||||
|
|
||||||
async function writeID3v2Tag(mp3Blob, metadata, coverBlob = null) {
|
async function writeID3v2Tag(mp3Blob, metadata, coverBlob = null) {
|
||||||
const frames = [];
|
const frames = [];
|
||||||
|
|
||||||
if (metadata.title) {
|
if (metadata.title) {
|
||||||
frames.push(createTextFrame('TIT2', metadata.title));
|
frames.push(createTextFrame('TIT2', getTrackTitle(metadata)));
|
||||||
}
|
}
|
||||||
|
|
||||||
const artistName = metadata.artist?.name || metadata.artists?.[0]?.name;
|
const artistName = metadata.artist?.name || metadata.artists?.[0]?.name;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { getCoverBlob, detectAudioFormat } from './utils.js';
|
import { getCoverBlob, detectAudioFormat, getTrackTitle } from './utils.js';
|
||||||
import { addMp3Metadata } from './id3-writer.js';
|
import { addMp3Metadata } from './id3-writer.js';
|
||||||
|
|
||||||
const VENDOR_STRING = 'Monochrome';
|
const VENDOR_STRING = 'Monochrome';
|
||||||
|
|
@ -565,7 +565,7 @@ function createVorbisCommentBlock(track) {
|
||||||
|
|
||||||
// Add standard tags
|
// Add standard tags
|
||||||
if (track.title) {
|
if (track.title) {
|
||||||
comments.push(['TITLE', track.title]);
|
comments.push(['TITLE', getTrackTitle(track)]);
|
||||||
}
|
}
|
||||||
const artistStr = getFullArtistString(track);
|
const artistStr = getFullArtistString(track);
|
||||||
if (artistStr) {
|
if (artistStr) {
|
||||||
|
|
@ -930,7 +930,7 @@ function createMp4MetadataAtoms(track) {
|
||||||
// We'll create basic iTunes-style metadata
|
// We'll create basic iTunes-style metadata
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
'©nam': track.title || DEFAULT_TITLE,
|
'©nam': getTrackTitle(track) || DEFAULT_TITLE,
|
||||||
'©ART': getFullArtistString(track) || DEFAULT_ARTIST,
|
'©ART': getFullArtistString(track) || DEFAULT_ARTIST,
|
||||||
'©alb': track.album?.title || DEFAULT_ALBUM,
|
'©alb': track.album?.title || DEFAULT_ALBUM,
|
||||||
aART: track.album?.artist?.name || track.artist?.name || DEFAULT_ARTIST,
|
aART: track.album?.artist?.name || track.artist?.name || DEFAULT_ARTIST,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue