[PLUGIN] Randomizer Plugin

Randomizer is a plugin which gives the user three buttons to;

Play a random album.

Play a number of random tracks.

Play the album of the currently playing track.

The three functions are also available to lirc Remote Control users by adding;

config = node /data/plugins/miscellanea/randomizer/randomAlbum
config = node /data/plugins/miscellanea/randomizer/randomTracks
config = node /data/plugins/miscellanea/randomizer/trackToAlbum

to three spare buttons in their lircrc file.

The current number of random tracks is set to 25. Currently this can be changed by editing;
/data/plugins/miscellanea/randomizer/randomTracks
where more details can be found.
Possible future development may include a user definable number of tracks.

Randomizer is currently running on version 2.882.
If anyone wants to test it with Volumio 3 and report back I would be grateful.

At present it takes three clicks to get to the plugin buttons, life would be easier if the plugin could be reached directly from the main menu (as in the Radio Paradise plugin for example). Maybe if enough people wanted this - it might happen, I don’t know.

1 Like

@Old_Duffer if you post the git i will take a look

I would if I could! Very limited GitHub knowledge! Help!

No need to Git… The plugin is available in the plugin page

Which version of 3 should I download to test a plugin? The one I’ve tried has the plugins blocked.

oke …test 3.10 for you…

seems to work… but why not random in queue?

Never really thought of that. Double random?

there is already a random play in queue

Yes but I wanted a completely random queue, no deciding what to play, and then loading and playing an album if I liked the track

i have to create more folders for that most of the time i get or a motherload of songs
and with the second i get 1 song… but that is how you have your structure in your albums…

First, Thanks a lot for that plugin, that’s great !

Here is few suggestions which would be great to implement if possible…

  • As you wrote, have a “Random” button in the left UI Menu instead of have it in the plugins section
  • In the plugins section, add a radomizer’s setting for for change the tracks random’s number to play
  • Launch automaticaly the playlist after generate it.

Many thanks for your comments. I don’t know how to go about getting the plugin available directly from the main menu, I think it’s all up to the Volumio team and maybe how many people have requested it. Personally I have got it available from the settings menu, just above the sources option. In reality this only saves one click and will render Volumio unable to update. Not really worth the trouble. One click could be saved if the plugin menu opened on ‘installed plugins’ rather than the available plugins.

As far as the user definable number of random tracks is concerned, I’m sort of working on it but it looks as though it might be at the expense of the lirc remote function… still looking…

I’m interested to hear that the queue doesn’t start to play automatically, it should. Maybe there’s a timing issue. Are you getting all 25 tracks loaded into the queue?

Hi, thank you for reply.
I have made another tests. When i click on the random tracks button, only 9 tracks are added to the playlist. I presume there is an issue adding all the 25 tracks and then it is why it doesn’t lauch playlist after.

Ah ha. It seems that your system is taking longer to find and load your tracks than mine does. Are you up to editing a file? If so take a look at /data/plugins/miscellaneous/randomizer/randomTracks
and increase the timer variable (perhaps in increments of 10) until you get the full 25 and play should start automatically.

Sounds like it might be useful to set this in your plugin settings?

Hello
Because timer disconnect before 25 tracks is addded.
I have modified my randomTrack for playing imédiatly after first song added to queue. Disable timer if no necessary see below

socket.on('pushQueue', function(data) {
  if (data.length > tracks) {
    socket.disconnect()
  } else {
    if (data && data.length == 1) {
      socket.emit("play",{"value":0});
    } 
    socket.emit('browseLibrary', {'uri':'albums://'});
  }
});

//setTimeout(function() { socket.disconnect(); }, (tracks * timer));

Work perfectly

Thanks, I was just looking at the problem. As you say, it all seems to work - the main question being - why did I not do that in the first place?

@chsims1 I’ve edited the file on my GitHub page. Do I commit directly to the master branch or create a new branch and start a pull request?

My Github knowledge is what yours was about 6 weeks ago. :wink: Is it not just a case of issuing a new PR?

It is done. We shall learn together!