How can I sort albums by album length?

Get answers about using MediaMonkey 4 for Windows.

Moderator: Gurus

projectdamager

How can I sort albums by album length?

Post by projectdamager »

Hi!

I've been searching through these posts and seems that I can't find the answer - is it possible to sort albums in the library by the length of the albums? For example if I know I have time for like 40 minutes I would like to select an album shorter than that.

It seemed that Magic Nodes could help but I couldn't figure it out. Is there attribute called "album length" or should I make a script which counts the album length from the individual songs or how should this be done?

At this stage I'm also happy if someone tell's me it cannot be done because then I can move on and forget the damn thing :D
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Re: How can I sort albums by album length?

Post by Mizery_Made »

You can load up your library (by clicking on the Title node for instance) and then put it into "Album Art" view. Then, you can click on the Length column and it will sort based on the total length of the album. Not sure this will be effective for what you want to do, but it might. Not sure if it could be accomplished with MagicNodes. You could always post a reply in that scripts thread, someone more familiar with the script may be able to give you a definitive answer and maybe provide you with everything you need to set up a node to do it.
Guest

Re: How can I sort albums by album length?

Post by Guest »

Code: Select all

Album (sort by length)|Child of:Album\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:0>
rrfpacker
Posts: 1065
Joined: Sat Jul 12, 2008 5:47 pm

Re: How can I sort albums by album length?

Post by rrfpacker »

If I wanted to filter this by albums with more than "x" tracks (to eliminate those songs for which I don't have the whole album, just the singles from the album), what would I add to the current mask?
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Re: How can I sort albums by album length?

Post by Mizery_Made »

Code: Select all

Album (sort by length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) = Max(Cast(TrackNumber As integer)) AND Count(TrackNumber) > 3)\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:0>
That adds the SQL for the "Complete Albums" node to what you already had. This will then only show tracks which have more than three tracks (changeable by changing the "3" in "Count(TrackNumber) > 3" to the number of your choice) and where the number of tracks in the album equals the highest track number. Thus, if the highest track number is 18, you would need to have 18 tracks in the album for it to appear. I could be wrong, but I think the use of "101, 102, 103... 201, 202, 203..." for distinguishing Discs won't work with this though.

Or, if you're only interested in counting albums if they have more than say, three tracks and don't care if you're missing one or two tracks from it, then this might do the trick:

Code: Select all

Album (sort by length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) > 25)\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:0>
Both of these work with the Track # field, so if you've got albums laying around without track numbers, then I don't believe they would appear either. Anyway, hopefully one of these will be helpful. If not, then sit tight as someone who better knows what they're doing with the MagicNodes script stops by, cause I honestly don't really mess with it much.
rrfpacker
Posts: 1065
Joined: Sat Jul 12, 2008 5:47 pm

Re: How can I sort albums by album length?

Post by rrfpacker »

So in your second example listed below, shouldn't the number 25, be whatever number I want so I exclude One or Two Hit Wonders, such as 2 or 3? Just want to make sure. Thank you.


Album (sort by length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) > 25)\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:0>
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Re: How can I sort albums by album length?

Post by Mizery_Made »

Yeah, that's the number you would need to change. So, setting it to three would mean that an album would need four or more tracks to be considered for the node.
rrfpacker
Posts: 1065
Joined: Sat Jul 12, 2008 5:47 pm

Re: How can I sort albums by album length?

Post by rrfpacker »

OK, got it. Boy it took a long time to get this done.

I thought you could click copy all and just paste the mask. Doesn't seem to work that way.

One thing that would be cool is if the actual length of the album showed up in the node with the album. Any idea how to do that, anyone?
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Re: How can I sort albums by album length?

Post by Mizery_Made »

You actually can copy and paste the mask. You just bring up the Magic Nodes Settings box, and then either click New (to create a new node) or find the node you want to edit in the Caption drop. Then, you can just paste the given mask into the Mask text field and then choose Add or Update (depending on if you're adding a new node, or changing a current one).

As for the other part:
Album (sort by length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) > 25)\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:0|Statistic:Sum(Length)>
The bolded red(?) part will add the total length of the album to the album node. Thus, you'll see something in the vein of "Better Dayz (2Pac) (01:52:52)" as opposed to just "Better Dayz (2Pac)". If you want to try and just copy and paste, be sure to change the italic blue(?) part (the number of tracks as previously discussed). This take care of what you're looking to do?

EDIT: Actually, there's another option for you:
Album (sort by length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) > 25)\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:1>
This one would instead show the node in the format of "01:52:52 - Better Dayz (2Pac)" which would better represent the sort. Just adjust the bold red(?) part in your current node for this display. Or if you just copy and paste, be sure to adjust the italic blue(?) part.
rrfpacker
Posts: 1065
Joined: Sat Jul 12, 2008 5:47 pm

Re: How can I sort albums by album length?

Post by rrfpacker »

Oh my this worked so well. Thank you so much Misery_Made.

My problem when I try to copy/paste is that I get the error message "This mask is not valid!" in the lower left. I have to edit a mask before it will work. I know in the past, I've been able to copy/paste but not now.

Anyway, thank you so much for the help. Both of your suggestions work perfectly.
PartyRambo
Posts: 34
Joined: Sat Apr 19, 2008 7:54 pm

Re: How can I sort albums by album length?

Post by PartyRambo »

rrfpacker wrote:My problem when I try to copy/paste is that I get the error message "This mask is not valid!" in the lower left. I have to edit a mask before it will work. I know in the past, I've been able to copy/paste but not now.
Worked fine for me to copy/paste.

Can anyone help with how to modify this mask to sort by Album NAME with the album length listed...
I've tried several variations of ALBUM replacing LENGTH with no luck... I'm not quite catching the formatting...
rrfpacker
Posts: 1065
Joined: Sat Jul 12, 2008 5:47 pm

Re: How can I sort albums by album length?

Post by rrfpacker »

Maybe I'm copy/pasting to the wrong place. I try to paste in the bottom most window which I believe says Mask. I don't do anything else and I get the error message.
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: How can I sort albums by album length?

Post by onenonymous »

PartyRambo wrote:Can anyone help with how to modify this mask to sort by Album NAME with the album length listed...
I've tried several variations of ALBUM replacing LENGTH with no luck... I'm not quite catching the formatting...
I think this does it:

Code: Select all

Album (sort by name with Album Length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) > 25)\<Album with Album Artist|Statistic:Sum(Length)>
The second mask above has an extra ) at the end. Here's the corrected version I think:

Code: Select all

Album (sort by length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) > 25)\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:1>
Mizery_Made
Posts: 2283
Joined: Tue Aug 29, 2006 1:09 pm
Location: Kansas City, Missouri, United States

Re: How can I sort albums by album length?

Post by Mizery_Made »

Oops. My bad.
PartyRambo
Posts: 34
Joined: Sat Apr 19, 2008 7:54 pm

Re: How can I sort albums by album length?

Post by PartyRambo »

onenonymous wrote:
PartyRambo wrote:Can anyone help with how to modify this mask to sort by Album NAME with the album length listed...
I've tried several variations of ALBUM replacing LENGTH with no luck... I'm not quite catching the formatting...
I think this does it:

Code: Select all

Album (sort by name with Album Length)|Child of:Album|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) > 25)\<Album with Album Artist|Statistic:Sum(Length)>
Beautiful! I guess I'm still dumb, since I now wanna follow-up:
Is there a resource for this scripting language? I've no problem fooling around to find what I need, but I have been going nowhere with this, hence the need for help!

I would now like to see if:
- this can have Folder, AlbumArtist added, so it would display something like:
"M=Ma Roman=A Thousand and One Leavings (52:14)" - and, I could do without the seconds if possible!

Also - having the (what I now call) "Root Folder" (the M of "L:\M\" or "Movie Themes" of "L:\Movie Themes\") as an expandable branch, would allow me to find all the M's (albums as the script was answered, or album artists as well!) without expanding my library's 10,000 albums.

So, ONE thing that I'd like to see:
....
K
L
M - (click to expand)
M=Ma Roman=A Thousand and One Leavings (52)
M=Mannfred Mann=The Best (43)
...more M's...
N
O
...

Any help - if someone can do it quick, great!! But I'm good with some tutorial direction!
Post Reply