Move playlist item to top/bottom

Forums:

Perhaps I'm not looking in the right place but from what I gather, the only way to organize the playlists is to use:

u - Move playlist item up
j - Move playlist item down

Two of the most useful features that I found was in herrie;

Move playlist item to top
Move playlist item to bottom

The use case isn't as obvious as one could imagine;

Here is what happens when I add an entire metallica album;

IMAGE(http://i.imgur.com/c9nBlUY.png)

You'll notice that Track 10 and 11 are considered before 1 to 9, due to the way strings sort. This makes sense from a programming standpoint, but to correct this in moc, I need to;

  • Navigate to the right pane
  • Press j ten times
  • Press home
  • Press j ten times

And the content is in the proper order.

What I'm proposing shortens this tedius process;

  • Navigate to the right pane
  • Press Move playlist item to top shortcut key.
  • Press home
  • Press Move playlist item to top shortcut key.

If someone noticies this and likes the idea, but doesn't have time to help implement it, perhaps they could guide me to the section where the key commands are written so perhaps I can write a patch!

It seems I can't edit nodes I own.

A correction to the last section;

  • Navigate to the right pane
  • Press Move playlist item to bottom shortcut key.
  • Press home
  • Press Move playlist item to bottom shortcut key.

I've started working on a patch;

My C is rather rusty, so it'd be nice if someone could help me modify the move_item command to loop untill the playlist items are in the right place.

Here's what I have so far;

https://gist.github.com/josefnpat/5261058