From 24c3c8dda880111ada14a3b8b17b61cf2b6ba718 Mon Sep 17 00:00:00 2001 From: Giovanni Fulco Date: Fri, 17 Nov 2023 17:35:36 +0100 Subject: [PATCH] [Feature] Support subsonic server side scrobbling #337 (#338) --- README.md | 1 + app/bin/run-upmpdcli.sh | 11 +++++++++++ app/conf/upmpdcli.conf | 1 + doc/change-history.md | 1 + 4 files changed, 14 insertions(+) diff --git a/README.md b/README.md index f3c622d..36db408 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,7 @@ SUBSONIC_PORT|Subsonic port, defaults to `4533` SUBSONIC_USER|Subsonic username SUBSONIC_PASSWORD|Subsonic password SUBSONIC_LEGACYAUTH|Subsonic legacy authentication (`yes`|`no`), set to `true` when using Lightweight Media Server (LMS) (requires subsonic-connector >= 0.2.6) +SUBSONIC_SERVER_SIDE_SCROBBLING|Subsonic server side scrobbling (`yes`|`no`), set to `true` if you want to enable SUBSONIC_ITEMS_PER_PAGE|Number of items per page, defaults to `100` SUBSONIC_APPEND_YEAR_TO_ALBUM|If set to `yes` (default), the album year is appended to the album SUBSONIC_APPEND_CODECS_TO_ALBUM|If set to `yes` (default), the codecs for the album are appended to the album unless all codecs are in the white list diff --git a/app/bin/run-upmpdcli.sh b/app/bin/run-upmpdcli.sh index 328362f..cc7f331 100644 --- a/app/bin/run-upmpdcli.sh +++ b/app/bin/run-upmpdcli.sh @@ -390,6 +390,17 @@ if [ "${SUBSONIC_ENABLE^^}" == "YES" ]; then sed -i 's/\#subsoniclegacyauth/subsoniclegacyauth/g' $CONFIG_FILE sed -i 's/SUBSONIC_LEGACYAUTH/'"$legacy_auth_value"'/g' $CONFIG_FILE fi + if [[ -n "${SUBSONIC_SERVER_SIDE_SCROBBLING}" ]]; then + server_side_scrobbling=0 + if [[ "${SUBSONIC_SERVER_SIDE_SCROBBLING^^}" == "YES" || "${SUBSONIC_SERVER_SIDE_SCROBBLING^^}" == "Y" ]]; then + server_side_scrobbling=1 + elif [[ ! ("${SUBSONIC_SERVER_SIDE_SCROBBLING^^}" == "NO" || "${SUBSONIC_SERVER_SIDE_SCROBBLING^^}" == "N") ]]; then + echo "Invalid SUBSONIC_SERVER_SIDE_SCROBBLING [${SUBSONIC_SERVER_SIDE_SCROBBLING}]" + exit 2 + fi + sed -i 's/\#subsonicserversidescrobbling/subsonicserversidescrobbling/g' $CONFIG_FILE + sed -i 's/SUBSONIC_SERVER_SIDE_SCROBBLING/'"$server_side_scrobbling"'/g' $CONFIG_FILE + fi if [[ -n "${SUBSONIC_ITEMS_PER_PAGE}" ]]; then sed -i 's/\#subsonicitemsperpage/subsonicitemsperpage/g' $CONFIG_FILE sed -i 's/SUBSONIC_ITEMS_PER_PAGE/'"$SUBSONIC_ITEMS_PER_PAGE"'/g' $CONFIG_FILE diff --git a/app/conf/upmpdcli.conf b/app/conf/upmpdcli.conf index 0f23bb9..1a4f122 100644 --- a/app/conf/upmpdcli.conf +++ b/app/conf/upmpdcli.conf @@ -107,6 +107,7 @@ upradiostitle = Upmpdcli Radio List #subsonicwhitelistcodecs = SUBSONIC_WHITELIST_CODECS #subsonictranscodecodec = SUBSONIC_TRANSCODE_CODEC #subsonictranscodemaxbitrate = SUBSONIC_TRANSCODE_MAX_BITRATE +#subsonicserversidescrobbling = SUBSONIC_SERVER_SIDE_SCROBBLING #tidaluser = tidal #tidalautostart = TIDAL_AUTOSTART #tidaltokentype = TIDAL_TOKEN_TYPE diff --git a/doc/change-history.md b/doc/change-history.md index 6289d12..09c89ea 100644 --- a/doc/change-history.md +++ b/doc/change-history.md @@ -2,6 +2,7 @@ Change Date|Major Changes ---|--- +2023-11-17|Support for subsonic server side scrobbling (see issue [#337](https://github.com/GioF71/upmpdcli-docker/issues/337)) 2023-11-17|Write subsonic legacy auth configuration properly (see issue [#335](https://github.com/GioF71/upmpdcli-docker/issues/335)) 2023-11-16|Add variable PLG_PROXY_METHOD (see issue [#325](https://github.com/GioF71/upmpdcli-docker/issues/325)) 2023-11-15|Clarification about new subsonic features (see issue [#320](https://github.com/GioF71/upmpdcli-docker/issues/320))