Skip to content

Commit

Permalink
[Maintenance] Support newer versions of subsonic-connect library #318
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Nov 15, 2023
1 parent 9a31195 commit c7d05e2
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 538 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-multi-arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
declare -A base_images
base_images[mantic]=ubuntu:mantic
base_images[lunar]=ubuntu:lunar
base_images[kinetic]=ubuntu:kinetic
base_images[jammy]=ubuntu:jammy
base_images[bookworm]=debian:bookworm-slim
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,16 @@ ENV SUBSONIC_BASE_URL ""
ENV SUBSONIC_PORT ""
ENV SUBSONIC_USER ""
ENV SUBSONIC_PASSWORD ""
ENV SUBSONIC_LEGACYAUTH ""
ENV SUBSONIC_ITEMS_PER_PAGE ""
ENV SUBSONIC_APPEND_YEAR_TO_ALBUM ""
ENV SUBSONIC_APPEND_CODECS_TO_ALBUM ""
ENV SUBSONIC_WHITELIST_CODECS ""
ENV SUBSONIC_DOWNLOAD_PLUGIN ""
ENV SUBSONIC_PLUGIN_BRANCH ""
ENV SUBSONIC_FORCE_CONNECTOR_VERSION ""
ENV SUBSONIC_TRANSCODE_CODEC ""
ENV SUBSONIC_TRANSCODE_MAX_BITRATE ""

ENV TIDAL_ENABLE ""
ENV TIDAL_TOKEN_TYPE ""
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ I am now a contributor to upmpdcli for this plugin. See the git repository forks
The plugin uses my [subsonic-connector](https://github.com/GioF71/subsonic-connector) library which in turn is built around [py-sonic](https://github.com/crustymonkey/py-sonic).
Everything has been developed and tested against [Navidrome](https://www.navidrome.org/) but should work with other servers hopefully.
See [this](https://github.com/navidrome/navidrome/discussions/2324) discussion on the Navidrome repo for updates and further information.
The current version of the image includes Subsonic Plugin version `0.2.6`.
The current version of the image includes Subsonic Plugin version `0.1.17`.
If you use upmpdcli as a renderer for this plugin, you might probably want to setup a scrobbler, so that the Subsonic server can keep track of what you are playing. See [this](https://github.com/GioF71/mpd-subsonic-scrobbler) repository for more details.

### Scrobbling
Expand Down Expand Up @@ -204,12 +204,16 @@ SUBSONIC_BASE_URL|Subsonic base url. Example: `http://my_navidrome.homelab.local
SUBSONIC_PORT|Subsonic port, defaults to `4533`
SUBSONIC_USER|Subsonic username
SUBSONIC_PASSWORD|Subsonic password
SUBSONIC_LEGACYAUTH|Subsonic legacy authentication (`true`|`false`), set to `true` when using Lightweight Media Server (LMS)
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
SUBSONIC_WHITELIST_CODECS|List of comma-separated whitelist (ideally lossless) codecs. Defaults to `alac,wav,flac,dsf`
SUBSONIC_DOWNLOAD_PLUGIN|If set to `YES`, the updated plugin is downloaded from the upstream repo
SUBSONIC_PLUGIN_BRANCH|If `SUBSONIC_DOWNLOAD_PLUGIN`, the branch indicated by this variable will be used. Must be specified if enabling `SUBSONIC_DOWNLOAD_PLUGIN`. Suggested branch name is `latest-subsonic`
SUBSONIC_PLUGIN_BRANCH|If `SUBSONIC_DOWNLOAD_PLUGIN`, the branch indicated by this variable will be used. Must be specified if enabling `SUBSONIC_DOWNLOAD_PLUGIN`. Suggested branch name is `next-subsonic`
SUBSONIC_FORCE_CONNECTOR_VERSION|If set, the specified version of subsonic-connector will be installed over the one included in the image
SUBSONIC_TRANSCODE_CODEC|If set, the value will be used as the transcode codec
SUBSONIC_TRANSCODE_MAX_BITRATE|If set, the value will be used as the transcode max bitrate
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`
Expand Down
24 changes: 24 additions & 0 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,18 @@ echo "SUBSONIC_ENABLE=[$SUBSONIC_ENABLE]"
if [ "${SUBSONIC_ENABLE^^}" == "YES" ]; then
echo "Enabling Subsonic, processing settings";
SUBSONIC_ENABLE=YES
# do we need to download a newer subsonic-connector library?
if [[ -n "${SUBSONIC_FORCE_CONNECTOR_VERSION}" ]]; then
echo "Installing subsonic-connector version [${SUBSONIC_FORCE_CONNECTOR_VERSION}]"
break_needed=`cat /app/conf/pip-install-break-needed`
pip_switch=""
if [[ "${break_needed}" == "yes" ]]; then
pip_switch="--break-system-packages"
fi
pip_cmd="pip install ${pip_switch} subsonic-connector==${SUBSONIC_FORCE_CONNECTOR_VERSION}"
echo "pip_cmd: [${pip_cmd}]"
eval $pip_cmd
fi
sed -i 's/\#subsonicuser/subsonicuser/g' $CONFIG_FILE
echo "SUBSONIC_AUTOSTART=[$SUBSONIC_AUTOSTART]"
if [[ -z "${SUBSONIC_AUTOSTART^^}" || "${SUBSONIC_AUTOSTART}" == "1" || "${SUBSONIC_AUTOSTART^^}" == "YES" ]]; then
Expand All @@ -366,6 +378,10 @@ if [ "${SUBSONIC_ENABLE^^}" == "YES" ]; then
echo "Setting subsonic password [$SUBSONIC_PASSWORD]"
sed -i 's/\#subsonicpassword/subsonicpassword/g' $CONFIG_FILE
sed -i 's/SUBSONIC_PASSWORD/'"$SUBSONIC_PASSWORD"'/g' $CONFIG_FILE
if [[ -n "${SUBSONIC_LEGACYAUTH}" ]]; then
sed -i 's/\#subsoniclegacyauth/subsoniclegacyauth/g' $CONFIG_FILE
sed -i 's/SUBSONIC_LEGACYAUTH/'"$SUBSONIC_LEGACYAUTH"'/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
Expand Down Expand Up @@ -396,6 +412,14 @@ if [ "${SUBSONIC_ENABLE^^}" == "YES" ]; then
sed -i 's/\#subsonicwhitelistcodecs/subsonicwhitelistcodecs/g' $CONFIG_FILE
sed -i 's/SUBSONIC_WHITELIST_CODECS/'"$SUBSONIC_WHITELIST_CODECS"'/g' $CONFIG_FILE
fi
if [[ -n "${SUBSONIC_TRANSCODE_CODEC}" ]]; then
sed -i 's/\#subsonictranscodecodec/subsonictranscodecodec/g' $CONFIG_FILE
sed -i 's/SUBSONIC_TRANSCODE_CODEC/'"$SUBSONIC_TRANSCODE_CODEC"'/g' $CONFIG_FILE
fi
if [[ -n "${SUBSONIC_TRANSCODE_MAX_BITRATE}" ]]; then
sed -i 's/\#subsonictranscodemaxbitrate/subsonictranscodemaxbitrate/g' $CONFIG_FILE
sed -i 's/SUBSONIC_TRANSCODE_MAX_BITRATE/'"$SUBSONIC_TRANSCODE_MAX_BITRATE"'/g' $CONFIG_FILE
fi
fi

echo "RADIO_PARADISE_ENABLE=[$RADIO_PARADISE_ENABLE]"
Expand Down
267 changes: 0 additions & 267 deletions app/conf/default-upmpdcli.conf

This file was deleted.

Loading

0 comments on commit c7d05e2

Please sign in to comment.