![]() |
Direct link to radiostation - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: Direct link to radiostation (/showthread.php?tid=2043) Pages:
1
2
|
RE: Direct link to radiostation - TheOldPresbyope - 01-08-2020 Not wishing to add a new work item to Tim's inexhaustible ToDo list [1], here's another client-side hint. The MPD command protocol includes a command_list_begin/command_list_end construction. To quote from the protocol specification Quote:To facilitate faster adding of files etc. you can pass a list of commands all at once using a command list. The command list begins with command_list_begin or command_list_ok_begin and ends with command_list_end. Based on that, here's a URL-encoded HTTP GET request for the moOde player hostname "moode" which when entered in my browser clears the player queue, loads the "Favorites" playlist into the queue, and starts playing the first playlist entry [2] in one fell swoop. Please note that this request is entered as a single line despite how it may be displayed when you read this post. Code: http://moode/command/?cmd=command_list_begin%0D%0Aclear%0D%0Aload%20Favorites%0D%0Aplay%200%0D%0Acommand_list_end The string "%0D%0A" is the URL-encoding for CRLF, %20 is the URL-encoding for ASCII space, so this GET request is the equivalent of Code: command_list_begin There's no fancy error handling here (e.g., the ACK error messages spoken of in the quote are ignored). The first command stops whatever is playing and clears the queue. If the named playlist doesn't exist, that's the end of the story. If the playlist exists, it's loaded. Then, if the specified playlist entry doesn't exist the player remains stopped. Obviously @DRONE7's proposal can be effected using this same command_list construction. Regards, Kent [1] adding a new endpoint to the API entails a fair amount of work which has to be planned, documented, executed, and tested. Defining the requirements is key. Feature creep is like kudzu and must be guarded against. [2] I forgot in my post yesterday that playlists begin at entry 0 not 1. Classic programmer mistake. RE: Direct link to radiostation - Tim Curtis - 01-08-2020 (01-08-2020, 05:56 AM)smolesen Wrote:(01-06-2020, 01:31 PM)Tim Curtis Wrote: MPD commands can be sent via Probably, but there would need to be more demand for such a feature. Keep in mind that features that make it to the TODO list compete with one another for developer time and they compete with bug fixes and updates. -Tim RE: Direct link to radiostation - DRONE7 - 01-08-2020 Thanks @TheOldPresbyope for the enlightenment ! Yes, works fine.... Code: http://<moode-ip-address>/command/?cmd=command_list_begin%0D%0Aclear%0D%0Aadd%20http://relay3.slayradio.org:8000/%0D%0Aplay%200%0D%0Acommand_list_end @smolesen could that be an answer for your 'direct link' ? RE: Direct link to radiostation - philrandal - 01-10-2020 (01-08-2020, 10:07 PM)DRONE7 Wrote: Thanks @TheOldPresbyope for the enlightenment !Should be trivial to add an option 'save shortcut' to generate a Windows style shortcut file along with the add to playlist options. Or generate the url for copying and pasting. RE: Direct link to radiostation - smolesen - 01-11-2020 (01-08-2020, 10:07 PM)DRONE7 Wrote: Thanks @TheOldPresbyope for the enlightenment ! Yes, that would definitely work for me. sorry if I didn't explain properly what I was looking for in the first place... Thanks for all the help... /Søren RE: Direct link to radiostation - TheOldPresbyope - 01-20-2020 @duracell80 I think you misunderstand the point of my post. I was merely showing how a comparable effect could be achieved with no change to moOde. Your focus on making moOde a radio player sui generis is admirable and I'm following the work closely, but look how much time you've put into it already. That's what happens to Tim every time someone throws a demand for a new capability over the fence. We know that almost anything can be done in software if one puts one's mind to it, but "design, implement, test, support" is a demanding work cycle. I stand by my solution as an easy win. Regards, Kent |