fix(downloads): write full track title to metadata

This commit is contained in:
Daniel 2026-02-28 16:55:37 +00:00 committed by GitHub
parent a7d0099c96
commit 120073aea4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -1,10 +1,10 @@
import { getCoverBlob } from './utils.js';
import { getCoverBlob, getTrackTitle } from './utils.js';
async function writeID3v2Tag(mp3Blob, metadata, coverBlob = null) {
const frames = [];
if (metadata.title) {
frames.push(createTextFrame('TIT2', metadata.title));
frames.push(createTextFrame('TIT2', getTrackTitle(metadata)));
}
const artistName = metadata.artist?.name || metadata.artists?.[0]?.name;

View file

@ -1,4 +1,4 @@
import { getCoverBlob, detectAudioFormat } from './utils.js';
import { getCoverBlob, detectAudioFormat, getTrackTitle } from './utils.js';
import { addMp3Metadata } from './id3-writer.js';
const VENDOR_STRING = 'Monochrome';
@ -565,7 +565,7 @@ function createVorbisCommentBlock(track) {
// Add standard tags
if (track.title) {
comments.push(['TITLE', track.title]);
comments.push(['TITLE', getTrackTitle(track)]);
}
const artistStr = getFullArtistString(track);
if (artistStr) {
@ -930,7 +930,7 @@ function createMp4MetadataAtoms(track) {
// We'll create basic iTunes-style metadata
const tags = {
'©nam': track.title || DEFAULT_TITLE,
'©nam': getTrackTitle(track) || DEFAULT_TITLE,
'©ART': getFullArtistString(track) || DEFAULT_ARTIST,
'©alb': track.album?.title || DEFAULT_ALBUM,
aART: track.album?.artist?.name || track.artist?.name || DEFAULT_ARTIST,