Moode Forum
Album shows long date/time in stead of year - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: Album shows long date/time in stead of year (/showthread.php?tid=3224)



Album shows long date/time in stead of year - ycdtosa - 12-05-2020

Hi,

I noticed that some of my albums show a long date/time string (e.g. "1975-06-25T00:00:00Z") in stead of just the year.
This is in the Playback view where you also see the Album cover.

It looks like I was able to fix this by modifying function formatExtraTagsString() in file playerlib-nomin.js (added the green lines):

        if (MPD.json[element] != null && MPD.json[element] != 'Disc tag missing' && MPD.json[element] != 'Unknown') {
            elementDisplay = element == 'track' ? 'Track' : (element == 'disc' ? 'Disc' : '');

            if (element === 'date' && MPD.json['date'].length > 4) {
                MPD.json['date'] = MPD.json['date'].slice(0,4); // Only show the year.
            }

            extraTagsDisplay += ((elementDisplay == '' ? '' : elementDisplay + ' ') + MPD.json[element] + ' • ');
        }

Maybe it would be better to create a MPD.json['year'] in stead of modifying the MPD.json[] source, but I don't know much about PHP ...

Thanks, Willem

(using Moode on an Allo USBridge Signature)


RE: Album shows long date/time in stead of year - Tim Curtis - 12-05-2020

Hi Willem,

I'll check it out.


RE: Album shows long date/time in stead of year - TheOldPresbyope - 12-05-2020

As in so many other cases, there's no real standard for this metadata tag and one can find all kinds of nonsense in it. MPD says of it

Quote:date: the song’s release date. This is usually a 4-digit year.

Taking just the first 4 characters covers three possibilities: the original ID3 notion of a 4-char YYYY only, the MusicBrainz notion of a YYYY-MM-DD value, and the ISO 8601 variant shown in the OP. Close enough in my book!

Regards,
Kent