internet4000 / radio4000-player

Media player web component for playing Radio4000 channels and lists of video and media links (youtube, soundcloud, vimeo, <audio/>)
http://player.radio4000.com/
GNU General Public License v3.0
11 stars 4 forks source link

Tracks loaded through updatePlaylist are reversed #119

Open oskarrough opened 6 years ago

oskarrough commented 6 years ago

Whenever tracks are loaded into the player, we reverse the ordering.

This makes sense for Radio4000 channels as we want the newest track (e.g. last) rendered first in the list. But it does not make sense when you load something that isn't a Radio4000 channel, like local files. There you expect it to have whichever order you pass in.

The reverse is here: https://github.com/internet4000/radio4000-player/blob/master/src/Radio4000Player.vue#L171

And we also sort tracks fetched from R4 API here: https://github.com/internet4000/radio4000-player/blob/master/src/utils/store.js#L44

Not sure we do both but if we can ensure the reversing is only done for R4 channels and not when set through updatePlaylist() we should be good.

oskarrough commented 5 years ago

@hugurp what do you think? Seems counter intuitive that the order is reversed with updatePlaylist().

I'd propose we move the [].reverse() to where we fetch data from the API. This way it wouldn't affect tracks added through a playlist.