beefweb icon indicating copy to clipboard operation
beefweb copied to clipboard

Add Song to play queue from path

Open TheSquiddyLink opened this issue 7 months ago • 2 comments

I just want to say that BeefWeb has been absolutely amazing, and I have been using its API for a bunch of projects.

When working on a connection with the API, I was trying to add a song to the queue, but I noticed two things about it.

  1. To queue a song, you must have the playlist ID and the song index.
  2. When the queued song plays, it will change the current playlist to source song's playlist

Personally, I think having it instead of adding the song to the queue without changing the playlist would be extremely nice, as well as changing it to accept a file path for the input. Totally understand there are security risks with that, but since the number of songs in a playlist changes, going by the index of the song can make the script queue the wrong song if songs where added or removed to the playlist.

I personally like how the /context_command: "Add to playback queue" works, as this will accept the file path of the song and add it to the queue, so even if the song is on a different playlist or not on any, it will still play without changing the current playlist. I'm not sure if /context_command is native or a component I have installed on Foobar, so I do apologize for that.

Here is an example of the command

path\to\foobar2000\foobar2000.exe /context_command:"Add to playback queue" "path\to\song.mp3"

If nessisary, I can provide screenshots or videos.

Thank you for creating a wonderful server, and I am looking forward to your response.

TheSquiddyLink avatar May 10 '25 19:05 TheSquiddyLink

Hi, thanks for the suggestions.

I personally like how the /context_command: "Add to playback queue" works, as this will accept the file path of the song and add it to the queue

I'll take a look at this. Internally playback queue API operates on playlists, so there is a need to add track to some playlist first.

When the queued song plays, it will change the current playlist to source song's playlist

I think this is internal foobar2000 behavior.

hyperblast avatar May 11 '25 02:05 hyperblast

I find that interesting, because when running the command: foobar2000.exe /context_command:"Add to playback queue" "C:\Users\Squibs\Downloads\Foobar Test\001 - Mario Kart 8 .mp3", it will queue up the song, even though that file is not in any playlists, and it will not change the current playlist. Even with a brand new instillation of Foobar, I was able to run that command, without any playlist or music directory's, and it played the song.

I totally believe you that it works on playlists, as that would make sense, but because I am capable of add a song using an absolute path without giving it a playlist, makes me think both are ways to do it, that are handled separately. If you need me to do any tests, or provide videos, screenshots or reports let me know, ill be happy to assist with this!

TheSquiddyLink avatar May 11 '25 15:05 TheSquiddyLink