Skip to content

Commit

Permalink
245 feature autostart by default for uprcl and subsonic (#246)
Browse files Browse the repository at this point in the history
* [Feature] Autostart by default for uprcl and subsonic #245

* Fix condition evaluations for autostart

* set SUBSONIC_AUTOSTART to 1 when necessary

* update documentation for UPRCL_AUTOSTART and SUBSONIC_AUTOSTART with correct default
  • Loading branch information
GioF71 authored Aug 19, 2023
1 parent 572c0c3 commit d7e986d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ UPNPAV_SKIP_NAME_POSTFIX||If not set or set to `yes`, and if only `UPNPAV` rende
OPENHOME||Enable OpenHome services (`0`/`1`), defaults to `1`
OH_PRODUCT_ROOM||Sets `ohproductroom`, defaults to same value calculated for AV_FRIENDLY_NAME if upnp-av is enabled
UPRCL_ENABLE||Enable local music support (uprcl). Set to `yes` to enable
UPRCL_AUTOSTART||Autostart UPRCL if set to `1`
UPRCL_AUTOSTART||Autostart UPRCL, defaults to `1`
UPRCL_USER||Username for `uprcl`
UPRCL_HOSTPORT||Hostname and port for uprcl. Currently required when enabling UPRCL. Format: `<ip:port>`. Example value: `192.168.1.8:9090`.
UPRCL_TITLE|Local Music|Title for the media server
Expand All @@ -187,7 +187,7 @@ BBC_ENABLE||Enable BBC plugin. Set to `yes` to enable
BBC_PROGRAMME_DAYS||Past days in BBC Sounds catalog listing. This controls how many days are listed in the station displays.
RADIO_BROWSER_ENABLE||Enable the Radio Browser plugin. Set to `yes` to enable
SUBSONIC_ENABLE||Enable the Subsonic plugin. Set to `yes` to enable
SUBSONIC_AUTOSTART||Autostart SubSonic plugin if set to `1`
SUBSONIC_AUTOSTART||Autostart SubSonic plugin, defaults to `1`
SUBSONIC_BASE_URL||SubSonic base url. Example: `http://my_navidrome.homelab.local`
SUBSONIC_PORT||SubSonic port, defaults to `4533`
SUBSONIC_USER||SubSonic username
Expand Down Expand Up @@ -262,6 +262,7 @@ Just be careful to use the tag you have built.

Change Date|Major Changes
---|---
2023-08-20|Autostart by default for subsonic and uprcl (see issue [#245](https://github.com/GioF71/upmpdcli-docker/issues/245))
2023-08-19|Fixed documentation for `UPRCL_USER` (see issue [#241](https://github.com/GioF71/upmpdcli-docker/issues/241))
2023-08-19|Add autostart for radios (see issue [#239](https://github.com/GioF71/upmpdcli-docker/issues/239))
2023-08-19|Removed references to tidal plugin (see issue [#237](https://github.com/GioF71/upmpdcli-docker/issues/237))
Expand Down
9 changes: 6 additions & 3 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ if [ "${RADIOS_ENABLE^^}" == "YES" ]; then
echo "Enabling Radios";
RADIOS_ENABLE=YES
sed -i 's/\#upradiosuser/upradiosuser/g' $CONFIG_FILE;
if [[ -z "${RADIOS_AUTOSTART}" || "${RADIOS_AUTOSTART^^}" == "1" ]]; then
if [[ -z "${RADIOS_AUTOSTART}" || "${RADIOS_AUTOSTART}" == "1" || "${RADIOS_AUTOSTART^^}" == "YES" ]]; then
RADIOS_AUTOSTART=1
sed -i 's/\#upradiosautostart/upradiosautostart/g' $CONFIG_FILE;
set_parameter $CONFIG_FILE RADIOS_AUTOSTART "$RADIOS_AUTOSTART" upradiosautostart
Expand Down Expand Up @@ -269,8 +269,10 @@ if [ "${SUBSONIC_ENABLE^^}" == "YES" ]; then
SUBSONIC_ENABLE=YES
sed -i 's/\#subsonicuser/subsonicuser/g' $CONFIG_FILE
echo "SUBSONIC_AUTOSTART=[$SUBSONIC_AUTOSTART]"
if [ "${SUBSONIC_AUTOSTART^^}" == "YES" ]; then
if [[ -z "${SUBSONIC_AUTOSTART^^}" || "${SUBSONIC_AUTOSTART}" == "1" || "${SUBSONIC_AUTOSTART^^}" == "YES" ]]; then
SUBSONIC_AUTOSTART=1
sed -i 's/\#subsonicautostart/subsonicautostart/g' $CONFIG_FILE;
set_parameter $CONFIG_FILE SUBSONIC_AUTOSTART "$SUBSONIC_AUTOSTART" subsonicautostart
fi
echo "Setting subsonic base_url [$SUBSONIC_BASE_URL]"
sed -i 's/\#subsonicbaseurl/subsonicbaseurl/g' $CONFIG_FILE
Expand Down Expand Up @@ -375,7 +377,8 @@ if [ "${UPRCL_ENABLE^^}" == "YES" ]; then
sed -i 's/UPRCL_HOSTPORT/'"$UPRCL_HOSTPORT"'/g' $CONFIG_FILE;
fi
echo "UPRCL_AUTOSTART [$UPRCL_AUTOSTART]"
if [ -n "${UPRCL_AUTOSTART}" ]; then
if [[ -z "${UPRCL_AUTOSTART}" || "${UPRCL_AUTOSTART}" == "1" || "${UPRCL_AUTOSTART^^}" == "YES" ]]; then
UPRCL_AUTOSTART=1
echo "Setting uprclautostart $UPRCL_AUTOSTART"
sed -i 's/#uprclautostart/'"uprclautostart"'/g' $CONFIG_FILE;
sed -i 's/UPRCL_AUTOSTART/'"$UPRCL_AUTOSTART"'/g' $CONFIG_FILE;
Expand Down
2 changes: 1 addition & 1 deletion app/conf/upmpdcli.conf
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ upradiostitle = Upmpdcli Radio List
#scripts_dir = /usr/share/upmpdcli/src_scripts
#scscriptgracesecs = 2
#radio-browseruser = radio-browseruser
#subsonicautostart = 1
#subsonicautostart = SUBSONIC_AUTOSTART
#subsonicuser = SUBSONIC_USER
#subsonicpassword = SUBSONIC_PASSWORD
#subsonicbaseurl = SUBSONIC_BASE_URL
Expand Down

0 comments on commit d7e986d

Please sign in to comment.