Updated get_sorted_tracks to include playlists