Skip to content

Commit

Permalink
Add support for auto_update and auto_update_depth #397
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed May 3, 2024
1 parent d72beec commit c4f2d1f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ ENV REPLAYGAIN_LIMIT ""
ENV VOLUME_NORMALIZATION ""
ENV SAMPLERATE_CONVERTER ""

ENV AUTO_UPDATE ""
ENV AUTO_UPDATE_DEPTH ""

ENV SOXR_PLUGIN_ENABLE ""
ENV SOXR_PLUGIN_QUALITY ""
ENV SOXR_PLUGIN_THREADS ""
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ MAX_CONNECTIONS|This specifies the maximum number of clients that can be connect
MAX_PLAYLIST_LENGTH|The maximum number of songs that can be in the playlist, default is `16384`
MAX_COMMAND_LIST_SIZE|The maximum size a command list in KBYTES, default is `2048` (2 MiB)
MAX_OUTPUT_BUFFER_SIZE|The maximum size of the output buffer to a client (maximum response size), in KBYTES, default is 8192 (8 MiB)
AUTO_UPDATE|Set to `yes` to enable autoupdate of database
AUTO_UPDATE_DEPTH|Limit the depth of the directories being watched, `0` means only watch the music directory itself. There is no limit by default.
STARTUP_DELAY_SEC|Delay before starting the application in seconds, defaults to `0`

#### SOXR Plugin
Expand Down
22 changes: 22 additions & 0 deletions app/bin/run-mpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,29 @@ if [ -n "${MAX_OUTPUT_BUFFER_SIZE}" ]; then
echo "max_output_buffer_size \"${MAX_OUTPUT_BUFFER_SIZE}\"" >> $MPD_ALSA_CONFIG_FILE
fi

if [[ -n "${AUTO_UPDATE}" ]]; then
echo "AUTO_UPDATE=[{AUTO_UPDATE}]"
if [[ "${AUTO_UPDATE^^}" == "YES" ]] || [[ "${AUTO_UPDATE^^}" == "Y" ]]; then
echo "auto_update \"yes\"" >> $MPD_ALSA_CONFIG_FILE
elif [[ "${AUTO_UPDATE^^}" == "NO" ]] || [[ "${AUTO_UPDATE^^}" == "N" ]]; then
echo "auto_update \"no\"" >> $MPD_ALSA_CONFIG_FILE
else
echo "Invalid parameter AUTO_UPDATE [${AUTO_UPDATE}]"
exit 9
fi
fi

number_re="^[0-9]+$"
if [[ -n "${AUTO_UPDATE_DEPTH}" ]]; then
echo "AUTO_UPDATE_DEPTH=[{AUTO_UPDATE_DEPTH}]"
if ! [[ $AUTO_UPDATE_DEPTH =~ $number_re ]]; then
echo "Invalid parameter AUTO_UPDATE_DEPTH=[${AUTO_UPDATE_DEPTH}]"
exit 9
else
echo "auto_update_depth \"${AUTO_UPDATE_DEPTH}\"" >> $MPD_ALSA_CONFIG_FILE
fi
fi

if [[ -n "$STARTUP_DELAY_SEC" ]]; then
if ! [[ $STARTUP_DELAY_SEC =~ $number_re ]]; then
echo "Invalid parameter STARTUP_DELAY_SEC"
Expand Down
1 change: 1 addition & 0 deletions doc/change-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Date|Major Changes
:---|:---
2024-05-03|Add support for auto_update and auto_update_depth (see issue [#397](https://github.com/GioF71/mpd-alsa-docker/issues/397))
2024-03-15|Add support for ffmpeg decoder using `FFMPEG_ENABLED` (see issue [#389](https://github.com/GioF71/mpd-alsa-docker/issues/389))
2024-03-05|Add `NULL_OUTPUT_MIXER_TYPE` and doc updates (see issue [#385](https://github.com/GioF71/mpd-alsa-docker/issues/385))
2024-02-16|Completed support for resource limitation (see issue [#381](https://github.com/GioF71/mpd-alsa-docker/issues/381))
Expand Down

0 comments on commit c4f2d1f

Please sign in to comment.