One-pass sorting of the playlist. Fixes github [Issue-1]