Skip to content

Commit

Permalink
Issues #410, #412, plus some work (#419)
Browse files Browse the repository at this point in the history
- support tidal title #410
- support qobuz title #412
- remoded cachedir from template upmpdcli.conf
- further reduction of deps from template upmpdcli.conf
  • Loading branch information
GioF71 committed May 17, 2024
1 parent 9bc6141 commit f7ec64f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 44 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ ENV UPRCL_AUTOSTART ""
ENV CHECK_CONTENT_FORMAT ""

ENV QOBUZ_ENABLE no
ENV QOBUZ_TITLE ""
ENV QOBUZ_USERNAME qobuz_username
ENV QOBUZ_PASSWORD qobuz_password
ENV QOBUZ_FORMAT_ID 5
Expand Down Expand Up @@ -165,6 +166,7 @@ ENV SUBSONIC_TRANSCODE_MAX_BITRATE ""
ENV SUBSONIC_ENABLE_INTERNET_RADIOS ""

ENV TIDAL_ENABLE ""
ENV TIDAL_TITLE ""
ENV TIDAL_AUTH_CHALLENGE_TYPE ""
ENV TIDAL_AUDIO_QUALITY ""
ENV TIDAL_PREPEND_NUMBER_IN_ITEM_LIST ""
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ PLG_MICRO_HTTP_PORT|Port for the qobuz local HTTP service.
PLG_PROXY_METHOD|Proxy method, valid values are `proxy` and `redirect`, defaults to `redirect`
MEDIA_SERVER_FRIENDLY_NAME|Friendly name for the Media Server
TIDAL_ENABLE|Set to `YES` to enable Tidal support, defaults to `no`
TIDAL_TITLE|Set the title for Tidal plugin, defaults to `Tidal`
TIDAL_AUTH_CHALLENGE_TYPE|Default login challenge type, `OAUTH2` (default) or `PKCE`
TIDAL_QUALITY|Possible values are `LOW` (mp3@96k), `HIGH` (mp3@320k), `LOSSLESS` (flac 44.1kHz), `HI_RES` (I believe it's MQA), `HI_RES_LOSSLESS` (flac@hires), defaults to `LOSSLESS`
TIDAL_TOKEN_TYPE|Tidal oauth2 token type
Expand All @@ -264,6 +265,7 @@ TIDAL_PREPEND_NUMBER_IN_ITEM_LIST|Set to `yes` to create item numbers in lists (
TIDAL_DOWNLOAD_PLUGIN|If set to `YES`, the updated plugin is downloaded from the upstream repo
TIDAL_PLUGIN_BRANCH|If `TIDAL_DOWNLOAD_PLUGIN`, the branch indicated by this variable will be used. Must be specified if enabling `TIDAL_DOWNLOAD_PLUGIN`. Suggested branch name is `latest-tidal`
QOBUZ_ENABLE|Set to `yes` to enable Qobuz support, defaults to `no`
QOBUZ_TITLE|Set the title for Qobuz plugin, defaults to `Qobuz`
QOBUZ_USERNAME|Your Qobuz account username
QOBUZ_PASSWORD|Your Qobuz account password
QOBUZ_FORMAT_ID|Qobuz format id: 5 for mp3/320, 6 for FLAC, 7 for FLAC 24/96, 27 for hi-res, defaults to `5`
Expand Down
52 changes: 24 additions & 28 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ fi

cp $SOURCE_CONFIG_FILE $CONFIG_FILE

# set fixed value
echo "radiolist = /tmp/radiolist.conf" >> $CONFIG_FILE
echo "upradiostitle = Upmpdcli Radio List" >> $CONFIG_FILE

# log file support
if [ "${LOG_ENABLE^^}" == "YES" ]; then
sed -i "s/#logfilename/logfilename/g" $CONFIG_FILE
Expand Down Expand Up @@ -548,70 +552,61 @@ echo "TIDAL_ENABLE=[$TIDAL_ENABLE]"
if [ "${TIDAL_ENABLE^^}" == "YES" ]; then
echo "Enabling new Tidal, processing settings";
TIDAL_ENABLE=YES
sed -i 's/\#tidaluser/tidaluser/g' $CONFIG_FILE
echo "tidaluser = tidaluser" >> $CONFIG_FILE
if [[ -n "${TIDAL_TITLE}" ]]; then
echo "tidaltitle = ${TIDAL_TITLE}" >> $CONFIG_FILE
fi
echo "TIDAL_AUTOSTART=[$TIDAL_AUTOSTART]"
if [[ -z "${TIDAL_AUTOSTART^^}" || "${TIDAL_AUTOSTART}" == "1" || "${SUBSONIC_AUTOSTART^^}" == "YES" ]]; then
TIDAL_AUTOSTART=1
sed -i 's/\#tidalautostart/tidalautostart/g' $CONFIG_FILE;
set_parameter $CONFIG_FILE TIDAL_AUTOSTART "$TIDAL_AUTOSTART" tidalautostart
echo "tidalautostart = $TIDAL_AUTOSTART" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_AUTH_CHALLENGE_TYPE}" ]]; then
echo "Setting Token Type [$TIDAL_AUTH_CHALLENGE_TYPE]"
sed -i 's/\#tidalauthchallengetype/tidalauthchallengetype/g' $CONFIG_FILE
sed -i 's,TIDAL_AUTH_CHALLENGE_TYPE,'"$TIDAL_AUTH_CHALLENGE_TYPE"',g' $CONFIG_FILE
echo "tidalauthchallengetype = $TIDAL_AUTH_CHALLENGE_TYPE" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_TOKEN_TYPE}" ]]; then
echo "Setting Token Type [$TIDAL_TOKEN_TYPE]"
sed -i 's/\#tidaltokentype/tidaltokentype/g' $CONFIG_FILE
sed -i 's,TIDAL_TOKEN_TYPE,'"$TIDAL_TOKEN_TYPE"',g' $CONFIG_FILE
echo "tidaltokentype = $TIDAL_TOKEN_TYPE" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_ACCESS_TOKEN}" ]]; then
echo "Setting Access Token [$TIDAL_ACCESS_TOKEN]"
sed -i 's/\#tidalaccesstoken/tidalaccesstoken/g' $CONFIG_FILE
sed -i 's,TIDAL_ACCESS_TOKEN,'"$TIDAL_ACCESS_TOKEN"',g' $CONFIG_FILE
echo "tidalaccesstoken = $TIDAL_ACCESS_TOKEN" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_REFRESH_TOKEN}" ]]; then
echo "Setting Refresh Token [$TIDAL_REFRESH_TOKEN]"
sed -i 's/\#tidalrefreshtoken/tidalrefreshtoken/g' $CONFIG_FILE
sed -i 's,TIDAL_REFRESH_TOKEN,'"$TIDAL_REFRESH_TOKEN"',g' $CONFIG_FILE
echo "tidalrefreshtoken = $TIDAL_REFRESH_TOKEN" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_EXPIRY_TIME}" ]]; then
echo "Setting Token Expiry Time [$TIDAL_EXPIRY_TIME]"
sed -i 's/\#tidalexpirytime/tidalexpirytime/g' $CONFIG_FILE
sed -i 's,TIDAL_EXPIRY_TIME,'"$TIDAL_EXPIRY_TIME"',g' $CONFIG_FILE
echo "tidalexpirytime = $TIDAL_EXPIRY_TIME" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_PKCE_TOKEN_TYPE}" ]]; then
echo "Setting PKCE Token Type [$TIDAL_PKCE_TOKEN_TYPE]"
sed -i 's/\#tidalpkcetokentype/tidalpkcetokentype/g' $CONFIG_FILE
sed -i 's,TIDAL_PKCE_TOKEN_TYPE,'"$TIDAL_PKCE_TOKEN_TYPE"',g' $CONFIG_FILE
echo "tidalpkcetokentype = $TIDAL_PKCE_TOKEN_TYPE" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_PKCE_ACCESS_TOKEN}" ]]; then
echo "Setting PKCE Access Token [$TIDAL_PKCE_ACCESS_TOKEN]"
sed -i 's/\#tidalpkceaccesstoken/tidalpkceaccesstoken/g' $CONFIG_FILE
sed -i 's,TIDAL_PKCE_ACCESS_TOKEN,'"$TIDAL_PKCE_ACCESS_TOKEN"',g' $CONFIG_FILE
echo "tidalpkceaccesstoken = $TIDAL_PKCE_ACCESS_TOKEN" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_PKCE_REFRESH_TOKEN}" ]]; then
echo "Setting PKCE Refresh Token [$TIDAL_PKCE_REFRESH_TOKEN]"
sed -i 's/\#tidalpkcerefreshtoken/tidalpkcerefreshtoken/g' $CONFIG_FILE
sed -i 's,TIDAL_PKCE_REFRESH_TOKEN,'"$TIDAL_PKCE_REFRESH_TOKEN"',g' $CONFIG_FILE
echo "tidalpkcerefreshtoken = $TIDAL_PKCE_REFRESH_TOKEN" >> $CONFIG_FILE
fi
if [[ -n "${TIDAL_PKCE_SESSION_ID}" ]]; then
echo "Setting PKCE Session Id [$TIDAL_PKCE_SESSION_ID]"
sed -i 's/\#tidalpkcesessionid/tidalpkcesessionid/g' $CONFIG_FILE
sed -i 's,TIDAL_PKCE_SESSION_ID,'"$TIDAL_PKCE_SESSION_ID"',g' $CONFIG_FILE
echo "tidalpkcesessionid = $TIDAL_PKCE_SESSION_ID" >> $CONFIG_FILE
fi
if [[ -z "$TIDAL_AUDIO_QUALITY" ]]; then
TIDAL_AUDIO_QUALITY="LOSSLESS"
fi
echo "Setting Audio Quality [$TIDAL_AUDIO_QUALITY]"
sed -i 's/\#tidalaudioquality/tidalaudioquality/g' $CONFIG_FILE
sed -i 's,TIDAL_AUDIO_QUALITY,'"$TIDAL_AUDIO_QUALITY"',g' $CONFIG_FILE
echo "tidalaudioquality = $TIDAL_AUDIO_QUALITY" >> $CONFIG_FILE
if [[ -n "${TIDAL_PREPEND_NUMBER_IN_ITEM_LIST}" ]]; then
echo "TIDAL_PREPEND_NUMBER_IN_ITEM_LIST=[${TIDAL_PREPEND_NUMBER_IN_ITEM_LIST}]"
if [[ "${TIDAL_PREPEND_NUMBER_IN_ITEM_LIST^^}" == "YES" || "${TIDAL_PREPEND_NUMBER_IN_ITEM_LIST^^}" == "Y" ]]; then
#set prependnumberinitemlist
sed -i 's/\#tidalprependnumberinitemlist/tidalprependnumberinitemlist/g' $CONFIG_FILE
sed -i 's,TIDAL_PREPEND_NUMBER_IN_ITEM_LIST,'"1"',g' $CONFIG_FILE
echo "tidalprependnumberinitemlist = 1" >> $CONFIG_FILE
elif [[ "${TIDAL_PREPEND_NUMBER_IN_ITEM_LIST^^}" != "NO" && "${TIDAL_PREPEND_NUMBER_IN_ITEM_LIST^^}" == "N" ]]; then
echo "Invalid TIDAL_PREPEND_NUMBER_IN_ITEM_LIST=[${TIDAL_PREPEND_NUMBER_IN_ITEM_LIST}]"
exit 3
Expand All @@ -622,6 +617,9 @@ fi
echo "Qobuz Enable [$QOBUZ_ENABLE]"
if [ "${QOBUZ_ENABLE^^}" == "YES" ]; then
echo "Processing Qobuz settings";
if [[ -n "${QOBUZ_TITLE}" ]]; then
echo "qobuztitle = ${QOBUZ_TITLE}" >> $CONFIG_FILE
fi
sed -i 's/\#qobuzuser/qobuzuser/g' $CONFIG_FILE;
sed -i 's/\#qobuzpass/qobuzpass/g' $CONFIG_FILE;
sed -i 's/\#qobuzformatid/qobuzformatid/g' $CONFIG_FILE;
Expand Down Expand Up @@ -676,8 +674,6 @@ if [ "${UPRCL_ENABLE^^}" == "YES" ]; then
sed -i 's/\#uprclconfdir/uprclconfdir/g' $CONFIG_FILE;
echo "enabling uprclconfdir"
sed -i 's/#uprclconfdir/'"uprclconfdir"'/g' $CONFIG_FILE;
echo "enabling cachedir"
sed -i 's/#cachedir/'"cachedir"'/g' $CONFIG_FILE;
echo "enabling uprclmediadirs"
sed -i 's/#uprclmediadirs/'"uprclmediadirs"'/g' $CONFIG_FILE;
echo "UPRCL_TITLE [$UPRCL_TITLE]"
Expand Down Expand Up @@ -738,7 +734,7 @@ if [ ! -w "$cache_directory" ]; then
else
echo "Cache directory [${cache_directory}] is writable"
fi
sed -i 's\CACHE_DIRECTORY\'"$cache_directory"'\g' $CONFIG_FILE
echo "cachedir = $cache_directory" >> $CONFIG_FILE

log_directory=/log
if [ ! -w "$log_directory" ]; then
Expand Down
16 changes: 0 additions & 16 deletions app/conf/upmpdcli.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
cachedir = CACHE_DIRECTORY
radiolist = /tmp/radiolist.conf
upradiostitle = Upmpdcli Radio List
#logfilename = LOG_DIRECTORY/upmpdcli.log
#log level defaults to 2
#loglevel = LOG_LEVEL
Expand Down Expand Up @@ -115,19 +112,6 @@ upradiostitle = Upmpdcli Radio List
#subsonictranscodemaxbitrate = SUBSONIC_TRANSCODE_MAX_BITRATE
#subsonicserversidescrobbling = SUBSONIC_SERVER_SIDE_SCROBBLING
#subsonictaginitialpageenabledir = SUBSONIC_ENABLE_INTERNET_RADIOS
#tidaluser = tidal
#tidalautostart = TIDAL_AUTOSTART
#tidalauthchallengetype = TIDAL_AUTH_CHALLENGE_TYPE
#tidaltokentype = TIDAL_TOKEN_TYPE
#tidalaccesstoken = TIDAL_ACCESS_TOKEN
#tidalrefreshtoken = TIDAL_REFRESH_TOKEN
#tidalexpirytime = TIDAL_EXPIRY_TIME
#tidalpkcetokentype = TIDAL_PKCE_TOKEN_TYPE
#tidalpkceaccesstoken = TIDAL_PKCE_ACCESS_TOKEN
#tidalpkcerefreshtoken = TIDAL_PKCE_REFRESH_TOKEN
#tidalpkcesessionid = TIDAL_PKCE_SESSION_ID
#tidalaudioquality = TIDAL_AUDIO_QUALITY
#tidalprependnumberinitemlist = TIDAL_PREPEND_NUMBER_IN_ITEM_LIST
# Radio Paradise
#radio-paradisetitle = Radio Paradise
#radio-paradiseuser = radioparadise
Expand Down
2 changes: 2 additions & 0 deletions doc/change-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Change Date|Major Changes
---|---
2024-05-17|Support title for Qobuz (see issue [#412](https://github.com/GioF71/upmpdcli-docker/issues/412))
2024-05-17|Support title for Tidal (see issue [#410](https://github.com/GioF71/upmpdcli-docker/issues/410))
2024-05-14|Set title for Radio Broswer (see issue [#413](https://github.com/GioF71/upmpdcli-docker/issues/413))
2024-05-14|Set title for Radio Paradise (see issue [#411](https://github.com/GioF71/upmpdcli-docker/issues/411))
2024-05-14|Switch to ubuntu noble (see issue [#409](https://github.com/GioF71/upmpdcli-docker/issues/409))
Expand Down

0 comments on commit f7ec64f

Please sign in to comment.