How can I sort albums by album length?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: How can I sort albums by album length?

Re: How can I sort albums by album length?

by PartyRambo » Mon Jan 04, 2010 7:38 pm

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!

Re: How can I sort albums by album length?

by Mizery_Made » Sun Jan 03, 2010 8:12 pm

Oops. My bad.

Re: How can I sort albums by album length?

by onenonymous » Sun Jan 03, 2010 7:52 pm

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>

Re: How can I sort albums by album length?

by rrfpacker » Sun Jan 03, 2010 6:28 pm

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.

Re: How can I sort albums by album length?

by PartyRambo » Sun Jan 03, 2010 5:49 pm

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...

Re: How can I sort albums by album length?

by rrfpacker » Sat Dec 19, 2009 2:28 am

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.

Re: How can I sort albums by album length?

by Mizery_Made » Sat Dec 19, 2009 1:24 am

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.

Re: How can I sort albums by album length?

by rrfpacker » Sat Dec 19, 2009 12:39 am

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?

Re: How can I sort albums by album length?

by Mizery_Made » Fri Dec 18, 2009 7:05 pm

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.

Re: How can I sort albums by album length?

by rrfpacker » Fri Dec 18, 2009 5:20 pm

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>

Re: How can I sort albums by album length?

by Mizery_Made » Mon Dec 14, 2009 3:37 am

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.

Re: How can I sort albums by album length?

by rrfpacker » Sun Dec 13, 2009 10:28 pm

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?

Re: How can I sort albums by album length?

by Guest » Wed Dec 02, 2009 3:03 am

Code: Select all

Album (sort by length)|Child of:Album\<Album with Album Artist|Sort by:Sum(Length)|Show sort key:0>

Re: How can I sort albums by album length?

by Mizery_Made » Sun Nov 29, 2009 6:46 pm

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.

How can I sort albums by album length?

by projectdamager » Sun Nov 29, 2009 6:06 pm

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

Top