Open oskarrough opened 6 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.
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.