Posts: 1,870
Threads: 43
Joined: Mar 2020
Reputation:
85
03-05-2024, 01:10 PM
(This post was last modified: 03-05-2024, 07:05 PM by the_bertrum.)
I think this coincided with the introduction of considering the month when sorting albums by year, but I may be wrong.
I'm sorting albums by Artist/Year, and all my tracks have a date tag, usually (although not always) just a year. There is a mix of MP3, M4A and FLAC, many tagged with Musicbrainz Picard, others done by a variety of other tagging software. The vast majority are sorting correctly and have the year in parentheses after the title as they should. Some however have no year, and sort alphabetically after those with a year. There is a date tag with a numeric year value in it in all cases and in fact they were always displayed correctly in previous versions.
I've tried several tagging programmes to look at the tags, and even removed and re-added the date tag on some, but all to no avail. I'm unable to find any common thing between the non-working albums either.
Anyone with any idea where to begin hunting?
----------------
Robert
Posts: 6,030
Threads: 177
Joined: Apr 2018
Reputation:
235
Not much info to go on here.
By this statement "Some however have no year, and sort alphabetically after those with a year", I presume you mean the have a date tag but moOde doesn't display it or sort on it.
Zip up a couple different tracks (preferably some with different formats, MP3, etc.) which don't behave, put the zip file somewhere we can reach it, and send the link to my, @ Nutul , and @ Tim Curtis, and at least one of us will have a look. (Tim's really busy with the port to Bookworm and Pi 5, I'm busy until this afternoon, don't know what Al's up to, but between us I'm sure we'll find a few spare cycles.)
As an aside, date tags have always been a bit odd, thanks to decisions made in the industry back at the dawn of selling tracks rather than physical media.
Regards,
Kent
Posts: 1,870
Threads: 43
Joined: Mar 2020
Reputation:
85
Thanks Kent, creating a zip now.
The problem manifests in Tag and Album view, were the year is shown after the album name. The albums here in this screenshot for example, both have "date" tags with dates in and showed up correctly in the recent past.
----------------
Robert
Posts: 13,450
Threads: 305
Joined: Mar 2018
Reputation:
545
03-05-2024, 02:54 PM
(This post was last modified: 03-05-2024, 02:56 PM by Tim Curtis.)
(03-05-2024, 01:10 PM)the_bertrum Wrote: I think this coincided with the introduction of considering the month when sorting albums by year, but I may be wrong.
I'm sorting albums by Artist/Year, and all my tracks have a date tag, usually (although not always) just a year. There is a mix of MP3, M4A and FLAC, many tagged with Musicbrainz Picard, others done by a variety of other tagging software. The vast majority are sorting correctly and have the year in parentheses after the title as they should. Some however have no year, and sort alphabetically after those with a year. There is a date tag with a numeric year value in it in all cases and in fact they were always displayed correctly in previous versions.
I've tried several tagging programmes to look at the tags, and even removed and re-added the date tag on some, but all to no avail. I'm unable to find any common thing between the non-working albums either.
Anyone with any idea where to begin hunting?
Do the date tags have hyphen (dash) separators?
There is this fixed queued for the Bookworm release
- FIX: MusicBrainz date format (with dashes) not being parsed
Posts: 1,870
Threads: 43
Joined: Mar 2020
Reputation:
85
Ah, that might well be it...
It is certainly true on the first few I've looked at.
----------------
Robert
Posts: 1,282
Threads: 24
Joined: Jun 2022
Reputation:
42
03-05-2024, 04:20 PM
(This post was last modified: 03-05-2024, 04:20 PM by Nutul.)
(03-05-2024, 02:31 PM)the_bertrum Wrote: Thanks Kent, creating a zip now.
The problem manifests in Tag and Album view, were the year is shown after the album name. The albums here in this screenshot for example, both have "date" tags with dates in and showed up correctly in the recent past.
As quick as I can: The track Furniteur/Perfect Lavender (PGR008)/01 Redundant Buzz.flac has no Date tag.
It has a Recorded date one, though...
See your offending files with mediainfo, it is so picky that you'll get all the errors sorted out... ;-)
Posts: 13,450
Threads: 305
Joined: Mar 2018
Reputation:
545
Here's the function if you want to add the line that strips the hyphens
/var/www/inc/music-library.php
Code: // Priority: OriginalDate, OriginalReleaseDate, Date
function getTrackYear($trackData) {
if (array_key_exists('OriginalDate', $trackData)) {
$trackDate = $trackData['OriginalDate'];
} else if (array_key_exists('OriginalReleaseDate', $trackData)) {
$trackDate = $trackData['OriginalReleaseDate'];
} else if (array_key_exists('Date', $trackData)) {
$trackDate = $trackData['Date'];
} else {
$trackDate = '';
}
// Strip dashes from MusicBrainz dates (contrib: general@dlg.xyz)
$trackDate = str_replace("-", "", $trackDate);
// Set month to 00 if not present
$trackYear = empty(substr($trackDate, 4, 2)) ? substr($trackDate, 0, 4) . '00' : substr($trackDate, 0, 6);
return $trackYear;
}
Posts: 1,870
Threads: 43
Joined: Mar 2020
Reputation:
85
Ah I see from that code that it also does Original Date before Date... That explains a lot. Some of the offending tracks have an original date with hyphens and a plain old date without.
----------------
Robert
Posts: 1,870
Threads: 43
Joined: Mar 2020
Reputation:
85
(03-05-2024, 04:20 PM)Nutul Wrote: (03-05-2024, 02:31 PM)the_bertrum Wrote: Thanks Kent, creating a zip now.
The problem manifests in Tag and Album view, were the year is shown after the album name. The albums here in this screenshot for example, both have "date" tags with dates in and showed up correctly in the recent past.
As quick as I can: The track Furniteur/Perfect Lavender (PGR008)/01 Redundant Buzz.flac has no Date tag.
It has a Recorded date one, though...
See your offending files with mediainfo, it is so picky that you'll get all the errors sorted out... ;-)
Well look at that! Every singe editor I used showed that as plain old Date...
It's also got hyphens...
----------------
Robert
Posts: 1,870
Threads: 43
Joined: Mar 2020
Reputation:
85
Boom! The hyphen code worked a treat, even on the Furniteur tracks that only have a "release date".
Thanks folks!
----------------
Robert
|