fix: correct year and date for "Heimweh" by Freddy Quinn and clarify metadata handling in track processing
All checks were successful
Build and Push Docker Image / docker (push) Successful in 5s

This commit is contained in:
2025-10-12 23:30:45 +02:00
parent 6001143bbf
commit 60988c224d
3 changed files with 8 additions and 6 deletions

View File

@@ -745,8 +745,8 @@
"mbid": null "mbid": null
}, },
"Freddy Quinn - Heimweh (Dort wo die Blumen blüh'n).opus": { "Freddy Quinn - Heimweh (Dort wo die Blumen blüh'n).opus": {
"year": 2006, "year": 1956,
"date": "2006-10-26", "date": "1956",
"title": "Heimweh (Dort wo die Blumen blüh'n)", "title": "Heimweh (Dort wo die Blumen blüh'n)",
"artist": "Freddy Quinn", "artist": "Freddy Quinn",
"mbid": "2e4c3d92-9103-48ee-9399-43d83a61872f" "mbid": "2e4c3d92-9103-48ee-9399-43d83a61872f"

View File

@@ -91,13 +91,14 @@ export async function loadDeck(playlistId = 'default') {
let title = jsonMeta?.title ?? path.parse(f).name; let title = jsonMeta?.title ?? path.parse(f).name;
let artist = jsonMeta?.artist ?? ''; let artist = jsonMeta?.artist ?? '';
// Only parse audio file if JSON doesn't have complete metadata // Only parse audio file if JSON doesn't have title or artist metadata
// Note: year is ONLY taken from years.json, never from audio file
if (!jsonMeta || !jsonMeta.title || !jsonMeta.artist) { if (!jsonMeta || !jsonMeta.title || !jsonMeta.artist) {
try { try {
const meta = await mmParseFile(fp, { duration: false }); const meta = await mmParseFile(fp, { duration: false });
title = jsonMeta?.title || meta.common.title || title; title = jsonMeta?.title || meta.common.title || title;
artist = jsonMeta?.artist || meta.common.artist || artist; artist = jsonMeta?.artist || meta.common.artist || artist;
year = jsonMeta?.year ?? meta.common.year ?? year; // year remains from years.json only - do not use meta.common.year
} catch (err) { } catch (err) {
// Log error but continue processing // Log error but continue processing
console.warn(`Failed to parse metadata for ${f}:`, err.message); console.warn(`Failed to parse metadata for ${f}:`, err.message);

View File

@@ -37,13 +37,14 @@ export async function listTracks(playlistId = 'default') {
let title = jsonMeta?.title ?? path.parse(f).name; let title = jsonMeta?.title ?? path.parse(f).name;
let artist = jsonMeta?.artist ?? ''; let artist = jsonMeta?.artist ?? '';
// Only parse audio file if JSON doesn't have complete metadata // Only parse audio file if JSON doesn't have title or artist metadata
// Note: year is ONLY taken from years.json, never from audio file
if (!jsonMeta || !jsonMeta.title || !jsonMeta.artist) { if (!jsonMeta || !jsonMeta.title || !jsonMeta.artist) {
try { try {
const meta = await mmParseFile(fp, { duration: false }); const meta = await mmParseFile(fp, { duration: false });
title = jsonMeta?.title || meta.common.title || title; title = jsonMeta?.title || meta.common.title || title;
artist = jsonMeta?.artist || meta.common.artist || artist; artist = jsonMeta?.artist || meta.common.artist || artist;
year = jsonMeta?.year ?? meta.common.year ?? year; // year remains from years.json only - do not use meta.common.year
} catch {} } catch {}
} }