Skip to content

Commit

Permalink
[Feature] Support for Mother Earth Radio #297 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 authored Oct 6, 2023
1 parent 6d70837 commit 3fa6577
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ ENV RADIO_PARADISE_ENABLE ""
ENV RADIO_PARADISE_DOWNLOAD_PLUGIN ""
ENV RADIO_PARADISE_PLUGIN_BRANCH ""

ENV MOTHER_EARTH_RADIO_ENABLE ""
ENV MOTHER_EARTH_RADIO_DOWNLOAD_PLUGIN ""
ENV MOTHER_EARTH_RADIO_PLUGIN_BRANCH ""

ENV PUID ""
ENV PGID ""

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ SUBSONIC_PLUGIN_BRANCH|If `SUBSONIC_DOWNLOAD_PLUGIN`, the branch indicated by th
RADIO_PARADISE_ENABLE|Enable the Radio Paradise Plugin, set to `yes` to enable
RADIO_PARADISE_DOWNLOAD_PLUGIN|If set to `YES`, the updated plugin is downloaded from the upstream repo
RADIO_PARADISE_PLUGIN_BRANCH|If `RADIO_PARADISE_DOWNLOAD_PLUGIN` is set to `yes`, the branch indicated by this variable will be used. Must be specified if enabling `RADIO_PARADISE_DOWNLOAD_PLUGIN`. Suggested branch name is `latest-radio-paradise`
MOTHER_EARTH_RADIO_ENABLE|Enable the Mother Earth Radio Plugin, set to `yes` to enable
MOTHER_EARTH_RADIO_DOWNLOAD_PLUGIN|If set to `YES`, the updated plugin is downloaded from the upstream repo
MOTHER_EARTH_RADIO_PLUGIN_BRANCH|If `MOTHER_EARTH_RADIO_DOWNLOAD_PLUGIN` is set to `yes`, the branch indicated by this variable will be used. Must be specified if enabling `MOTHER_EARTH_RADIO_DOWNLOAD_PLUGIN`. Suggested branch name is `latest-mother-earth-radio`
PLG_MICRO_HTTP_HOST|IP for the qobuz local HTTP service.
PLG_MICRO_HTTP_PORT|Port for the qobuz local HTTP service.
MEDIA_SERVER_FRIENDLY_NAME|Friendly name for the Media Server
Expand Down
30 changes: 30 additions & 0 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
# 1 Generic error
# 2 Invalid RENDERER_MODE value

if [[ "${MOTHER_EARTH_RADIO_DOWNLOAD_PLUGIN^^}" == "YES" ]]; then
echo "Downloading updated Mother Earth Radio plugin"
if [[ -n "${MOTHER_EARTH_RADIO_PLUGIN_BRANCH}" ]]; then
echo " using branch [$MOTHER_EARTH_RADIO_PLUGIN_BRANCH]"
cd /app
mkdir -p src
cd /app/src
git clone https://framagit.org/GioF71/upmpdcli.git --branch ${MOTHER_EARTH_RADIO_PLUGIN_BRANCH}
echo " copying updated files ..."
mkdir -p /usr/share/upmpdcli/cdplugins/mother-earth-radio
cp upmpdcli/src/mediaserver/cdplugins/mother-earth-radio/* /usr/share/upmpdcli/cdplugins/mother-earth-radio/
echo " copied, removing repo ..."
rm -Rf upmpdcli
echo " repo removed."
cd ..
rm -Rf src
echo " src directory removed."
fi
# return to the path
cd /app/bin
fi

if [[ "${RADIO_PARADISE_DOWNLOAD_PLUGIN^^}" == "YES" ]]; then
echo "Downloading updated Radio Paradise plugin"
if [[ -n "${RADIO_PARADISE_PLUGIN_BRANCH}" ]]; then
Expand Down Expand Up @@ -278,6 +300,7 @@ if [[ "${UPRCL_ENABLE^^}" == "YES" ||
"${DEEZER_ENABLE^^}" == "YES" ||
"${HRA_ENABLE^^}" == "YES" ||
"${RADIO_PARADISE_ENABLE^^}" == "YES" ||
"${MOTHER_EARTH_RADIO_ENABLE^^}" == "YES" ||
"${QOBUZ_ENABLE^^}" == "YES" ]]; then
MEDIA_SERVER_ENABLED=1
fi
Expand Down Expand Up @@ -382,6 +405,13 @@ if [ "${RADIO_PARADISE_ENABLE^^}" == "YES" ]; then
sed -i 's/\#radio-paradiseuser/radio-paradiseuser/g' $CONFIG_FILE
fi

echo "MOTHER_EARTH_RADIO_ENABLE=[$MOTHER_EARTH_RADIO_ENABLE]"
if [ "${MOTHER_EARTH_RADIO_ENABLE^^}" == "YES" ]; then
echo "Enabling Mother Earth Radio, processing settings";
MOTHER_EARTH_RADIO_ENABLE=YES
sed -i 's/\#mother-earth-radiouser/mother-earth-radiouser/g' $CONFIG_FILE
fi

echo "TIDAL_ENABLE=[$TIDAL_ENABLE]"
if [ "${TIDAL_ENABLE^^}" == "YES" ]; then
echo "Enabling new Tidal, processing settings";
Expand Down
3 changes: 3 additions & 0 deletions app/conf/default-upmpdcli.conf
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@
# Radio Paradise
#radio-paradiseuser = radioparadise

# Mother Earth Radio
#mother-earth-radiouser = motherearthradio

# Local Media Server parameters

# Bogus user name variable.
Expand Down
3 changes: 3 additions & 0 deletions app/conf/upmpdcli-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@
# Radio Paradise
#radio-paradiseuser = radioparadise

# Mother Earth Radio
#mother-earth-radiouser = motherearthradio

# Local Media Server parameters

# Bogus user name variable.
Expand Down
2 changes: 2 additions & 0 deletions app/conf/upmpdcli.conf
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@ upradiostitle = Upmpdcli Radio List
#tidalaudioquality = TIDAL_AUDIO_QUALITY
# Radio Paradise
#radio-paradiseuser = radioparadise
#mother-earth-radiouser = motherearthradio

26 changes: 25 additions & 1 deletion doc/example-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,38 @@ services:
- FRIENDLY_NAME=Radio Paradise (upmpdcli)
- CHECK_CONTENT_FORMAT=yes
- RADIO_PARADISE_ENABLE=yes
- RADIO_BROWSER_ENABLE=yes
- RADIO_PARADISE_DOWNLOAD_PLUGIN=yes
- RADIO_PARADISE_PLUGIN_BRANCH=latest-radio-paradise
restart: unless-stopped
```

Please not that RADIO_PARADISE_DOWNLOAD_PLUGIN is currently mandatory for the plugin to work, until a new upmpdcli release including the plugin is released.

### Mother Earth Radio

A simple upmpdcli instance for accessing Mother Earth Radio webradios:

```text
---
version: "3"
services:
upmpdcli:
image: giof71/upmpdcli:latest
container_name: upmpdcli-mother-earth-radio
network_mode: host
environment:
- RENDERER_MODE=NONE
- FRIENDLY_NAME=Mother Earth Radio (upmpdcli)
- CHECK_CONTENT_FORMAT=yes
- MOTHER_EARTH_RADIO_ENABLE=yes
- MOTHER_EARTH_RADIO_DOWNLOAD_PLUGIN=yes
- MOTHER_EARTH_RADIO_PLUGIN_BRANCH=latest-radio-paradise
restart: unless-stopped
```

Please not that MOTHER_EARTH_RADIO_DOWNLOAD_PLUGIN is currently mandatory for the plugin to work, until a new upmpdcli release including the plugin is released.

### Streaming Services

#### Tidal
Expand Down

0 comments on commit 3fa6577

Please sign in to comment.