fridgefm-radio-core icon indicating copy to clipboard operation
fridgefm-radio-core copied to clipboard

Suggestion: loop playlist with shuffle

Open feyli opened this issue 1 year ago • 1 comments

  • I'm submitting a ... [ ] feature request

  • Summary

It would just be great to have a way to do this: The radio starts, immediately shuffles the playlist, and plays it. When the playlist ends, the radio shuffles it again and plays it over. It would do this over and over, every time looping another shuffle of the same playlist.

feyli avatar Apr 20 '23 13:04 feyli

Hey! Thanks for the suggestion. Does this code cover your case?

const { SHUFFLE_METHODS } = require('@fridgefm/radio-core')

station.on(PUBLIC_EVENTS.START, () => {
  station.reorderPlaylist(SHUFFLE_METHODS.randomShuffle());
});

station.on(PUBLIC_EVENTS.RESTART, () => {
  station.reorderPlaylist(SHUFFLE_METHODS.randomShuffle());
});

ch1ller0 avatar Apr 24 '23 13:04 ch1ller0