Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Make it possible to maintain upmpdcli-radio.conf via Moode’s interface
#4
(12-05-2018, 10:44 AM)Zigzag Wrote: Thanks for coming back to me TheOldPresbyope.  Yup, your alternative of having a script that synchronizes the entries of upmpdcli.conf with the contents  of moOde's Radio directory would more than suffice.  My suggestion was OTT - I hope this idea of having a script instead is much easier to implement.

So I took advantage of some downtime yesterday to explore possibilities for a script. 

1. Getting basic station info from the .pls files in moOde's RADIO directory into upmpdcli-radio.conf (referenced by upmpdcli.conf in moOde) is reasonably trivial. 

Attached is a zip file of the 184 upmpdcli-radio.conf entries---station name and stream URL---I generated for the stations which are in the upcoming r4.4 RADIO directory. I imagine it would be straightforward for Tim to generate the same entries once he has the RADIO directory locked up in the late stages of preparing a moOde image.

You could either append these entries to your existing /etc/upmpdcli-radio.conf or replace it with them. Caveat: I did not try to validate the stream URLs. 

2. Getting station-artwork references into upmpdcli-radio.conf is harder. 

In moOde, the logos you see are stored in the local filesystem (IIRC, moOde has code to make use of  any remote links stored in its sqlite3 database but I see none in use at the moment).  Since upmpdcli requires a URL to pass to UPnP Control Points ("artUrl=" in the station entry), I referenced the nginx server already running in moOde to serve these logo files. This mostly works but there are two issues: 
  • necessarily, the stored URL contains the "protocol source", either hostname or IP address. This can be a problem because both are subject to change at any time after moOde has been installed on an RPi. Entries in upmpdcli-radio.conf would have to be adjusted each time this happened.
  • the local logo-filenames include characters like spaces, ampersands, and apostrophes which are "unsafe" in URLs. I've been stumped here. I have only two apps which can access moOde's UPnP radio directory, BubbleDS on my android phone and Linn Kazoo on my iPad. In limited experiments, I haven't found a method of encoding the URLs in such a way that both apps will display the logos; I've been able to please one or the other but not both at once. I need to look at the UPnP specs to figure out what is the "correct" encoding rather than try to infer it from the behavior of undocumented apps.
I haven't addressed the possibility of generating entries in upmpdcli-radio.conf from a named moOde playlist of radio stations. That could be a way to pare down those 184 stations to just the stations of interest. Neither have I addressed ongoing maintenance---adding/editing/deleting stations. 

And of course the sky's the limit if one starts with a clean sheet of paper but that's not going to happen.

Regards,
Kent

PS - this is for the version 1.2.x upmpdcli we are using. The newer v1.3.x has additional functionality including some scripting capabilities for radio entries which might be useful once we move to it. Still looks a bit experimental though.

PPS - before someone feels the necessity to pipe up, yes, I know there are APIs to fetch station artwork, indeed complete station info, from resources like Dirble (commercial) or Radio Browser (free) but they don't fit into the current framework. Maybe someday.


Attached Files
.zip   upmpdcli-radio.zip (Size: 4.26 KB / Downloads: 4)
Reply


Messages In This Thread
RE: Make it possible to maintain upmpdcli-radio.conf via Moode’s interface - by TheOldPresbyope - 12-10-2018, 05:22 PM

Forum Jump: