Add track to queue from plugin

Hello!
I’m writing a plugin for Volumio 3 for my jukebox. It works but i have a little problem, perhaps it is caused by my misunderstanding of docs…
My plugin add a queue when an user select a track from an external control panel; the plugin receives the message and the plugin emits the message

self.ioSocket.emit('addToQueue', {'uri': `${track_vpath}`});

On the web interface i see the server notifies the request of add (green popup in the upper right corner) but nothing is really added. If i do a scan of the library, then it adds everything.

I’ve added manually (via samba share) the tracks without rescan, i think that is the problem…so what is the correct procedure? how the plugin can start a rescan of the music library?
I have already a directory listener so i have an hook when some file is added/removed on certain directory…is it possible to start an update in this place.

Thanks a lot

Hello. You can use socket.emit(‘updateDb’) to update database and be able to play the file.

1 Like

thanks @balbuze
i’ll try right now :slight_smile:

it worked, now i have to put the workaround in the code correctly :smiley:
thanks again!

Hi @markov1983
Will you be releasing this as a plugin ?
With the amount of requests over the years for a jukebox mode (party mode) to be added to Volumio, this may be a popular addition to the plugin section.

Hello!!
It can be an idea, i worked on it for a very custom application. I designed a little breadboard to adapt a numerical keyboard and with an old HD44780 LCD display with an ESP32 module and two WS2812B led panels (one for audio spectrum and one for marquee light)…the ESP32 module interfaces itself throught a simple UART channel with Rpi1b+ running Volumio3 where my custom plugin is listening.
The plugin creates an ALSA custom audio splitter so i can capture audio and process it with CAVA to calculate spectrum and send to ESP32 that renders it on the led panel.
The keyboard let the user to modify volume and select track with a disk/track coding; in the juke box there is a page selector with a stepper motor and in each page you have 6 discs; the keyboard has two keys (left/right) that i use to move the motor with ESP32. The user can choose the track by selecting the disk and the track.

If someone wants to work on it i can help, it will be a pleasure. Right now i’m very busy but in future i can work on a standard interface so i can release something less specific :slight_smile:

Consider that i’m not a Node.Js programmer so the plugin code is really a mess i think.

Sorry for my bad english.

Hi @markov1983
More of a custom design than I had anticipated.

Over the years there has been a fair few requests for a Jukebox mode for Volumio.
ie. an interface or mode where your guests at a party could simply browse the media library, tap on it and it gets added to the bottom of the queue, without complications of acidentilly activating some other option in volumio. Pretty much like a public house Jukebox. Select your track and it goes to the bottom of the queue as simple as that.

I’m not a programmer, I wouldn’t know where to start really. Just wondering if the software side of it was similar to what has been requested.

Also there is no need to apologise for your English, its fine, probably better than mine and I live here :smiley:

1 Like

My application acts like a simple juke box controller, as you intended.
There is only a custom interface to select tracks and monitoring status (elapsed time, volume etc).
It adds to queue tracks as soon as selected by the user and start playing.

Are you from Italy? :smiley:

If it adds the tracks to the bottom / back of the queue so it doesnt interupt what is currently playing then it sounds like it could be right for the job.
When or if you have time, you should release it. I’m sure it would be an appreciated plugin.

I’m actually from England. Thats what I mean your English is probably better than mine.:smiley:

1 Like

:smiley:
thanks, i will do! i’m glad to help someone. I have a short videoclip of working system (today i’ve put everything together and it was very good :smiley: )
Unfortunately my raspberry pi1B+ is too slow to run efficiently Volumio and doesn’t have wifi :frowning:

Maybe time to upgrade your rpi…If you can find any where with stock at normal prices.

Have you uploaded your clip anywhere for viewing?

not yet, i will write here when i will do, perhaps on youtube :smiley:

Hey, I’ll hope someone could help me…
is there an API to remove tracks from queue after they are totally played? or i have to remove manually?
I tried the (not documented but it is used in the web interface) ‘clearQueue’ but it seems to stall the system…could someone help me?

Thanks a lot