Merge pull request #258 from DanTheMan827/write-full-title

fix(downloads): write full track title to metadata
This commit is contained in:
edidealt 2026-03-01 12:13:12 +02:00 committed by GitHub
commit 4b4d701e9f
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,