Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Album shows long date/time in stead of year
#1
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)
W
Reply
#2
Hi Willem,

I'll check it out.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
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
Reply


Forum Jump: