Thank you for your donation!


Sort albums by year
#1
Hello Tim,
long time ago in moOde 3.x i already asked for this, think its time to bring it up in this nice new forum again Big Grin 

In library view currently the albums are currently sorted by name alphabetically.
I (and certainly not only me) have a lot of discographies of an artist. And I am very used to display albums by year and not by name alphabetically.
Would be great if you could add an option to configuration to switch album sorting.

If you don't like the idea or it is low prio for you I would be very thankful if you could tell me the file and line where i could change this manually (permanently).

Thank you
Mario
Reply
#2
Hi,

MPD supports the Date tag which represents a song's release date. Generally this can be used to represent an Albums release date except for Compilation albums which usually contain songs that have different release dates.
https://www.musicpd.org/doc/user/tags.html

There is a tag called AlbumSort that could be used to specify the Album release date but I've never seen it present in any of my song files.

If you want to examine the code that generates the Library then start with /var/www/inc/playerlib.php and the function loadLibrary(). Then /var/www/js/playerlib.js and the function renderLibrary()

-Tim
Reply
#3
Hello Tim,
exactly, I am talking about the tag "date: the song's release date. This is usually a 4-digit year".
For me this date represents the year the CD/album was released. Of course on compilations it could be reffered to the individual release year of every single track, but I doubt that it is common to do that for an album?

Since I am trying to have a maximum of compatibility of my mp3 files (over as many players as possible, especially car radio systems) I am only using the most common tags (artist, album, title, track, name, date, composer, genre, comment), so no AlbumSort.

So is this something that you think would make sense to implement this switch for sorting according to 4digit years in date field?
Of course it would be very nice if album title is then also display including the date like "1975 - A Night at the Opera", to make clear why the sorting is not alphabetically anymore (but that would only be an addon).
Or is it only me who gets confused in an artist's discography if it is not sorted by release date? Blush

Mario
Reply
#4
Hi Mario,

Its not been a common request but you could try modifying the code yourself.

/var/www/inc/playerlib.php


function genLibrary($flat) {

Add the date to the line of code below, then reboot, open Sources and RESET the Library cache, then open the Library.

$album = $flatData['Album'] ? $flatData['Date'] . '-' . $flatData['Album'] : 'Unknown';

-Tim
Reply
#5
(05-09-2018, 03:17 PM)deztiny Wrote: Hello Tim,
exactly, I am talking about the tag "date: the song's release date. This is usually a 4-digit year".
For me this date represents the year the CD/album was released. Of course on compilations it could be reffered to the individual release year of every single track, but I doubt that it is common to do that for an album?

Since I am trying to have a maximum of compatibility of my mp3 files (over as many players as possible, especially car radio systems) I am only using the most common tags (artist, album, title, track, name, date, composer, genre, comment), so no AlbumSort.

So is this something that you think would make sense to implement this switch for sorting according to 4digit years in date field?
Of course it would be very nice if album title is then also display including the date like "1975 - A Night at the Opera", to make clear why the sorting is not alphabetically anymore (but that would only be an addon).
Or is it only me who gets confused in an artist's discography if it is not sorted by release date? Blush

Mario

Hi Mario,

but date on each song could be a problem for Best Of, anthology, VA or even soundtrack ... except if you retag yourself all your songs Wink

Why not, i've done that for AlbumSort tag (which is an standard ID3) to avoid that ... and my library looks like that :

[Image: mrc07we.png]

I used Mp3tag to retag in mass ... you could create your own Action for automation on directory including subdirs Wink

-Eric
Reply
#6
(05-09-2018, 05:24 PM)Tim Curtis Wrote: Hi Mario,

Its not been a common request but you could try modifying the code yourself.

/var/www/inc/playerlib.php


function genLibrary($flat) {

Add the date to the line of code below, then reboot, open Sources and RESET the Library cache, then open the Library.

$album = $flatData['Album'] ? $flatData['Date'] . '-' . $flatData['Album'] : 'Unknown';

-Tim

Tim, thank you soooo much, this works great! I am in heaven using moOde now Big Grin

Very tiny change to :
$album = $flatData['Album'] ? $flatData['Date'] . ' - ' . $flatData['Album'] : 'Unknown';

[Image: kbya6v.png]


Of course this now look a bit strange if you have selected more than one artist, like a hole genre but i would also not want to search through a ton of albums sorted alphabetically without selecting an artist anyway.

Also at Eric: yes it will not look nice if there are tracks of an album with different year dates. But i dont have that in my whole collection - since its fully CD based with one year date for all tracks of ar CD. I guess an individual track will only occur on mp3 collections not based on CDs. Then using "AlbumSort" tag instead of "date minus album" would probably be a better idea.
And yes, mp3tag is THE tag editor, I am using it for more than 15 years now Big Grin  Especially mass tagging, actions, regex... are sooo cool...

Mario
Reply
#7
Nice :-)

If I get more requests for this I can add to the TODO list.

-Tim
Reply
#8
I also would be very grateful for implementation of sorting of albums by year Smile

Tim, deztiny - thank you for guide, my variation below:
$album = $flatData['Album'] ? '[' . $flatData['Date'] . '] ' . $flatData['Album'] : 'Unknown';
resulting with: [Year] Album
Reply
#9
Hi,
+1 for this kind of feature.
Maybe they could be some choice in the "customize" menu. I would also add a per disc number classification
to me order should be :
(Style/genre) —> album artist —> album publication date —> Album name —> CD number —> track number

for classical song it's more with composer first

Tx
Rasptouch case with RPI3 + I2C 16x2 screen and IR port
Audiophonics I-Sabre V2.1 DAC ES9023 TCXO
Reply
#10
+2 for this feature Smile
Reply


Forum Jump: