Skip to content

Commit

Permalink
Fix for bug 626 - Spotify customization variables
Browse files Browse the repository at this point in the history
  • Loading branch information
laytonhayes authored and maggie44 committed Feb 6, 2023
1 parent 219d57f commit b245f12
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plugins/spotify/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [[ -n "$SOUND_DISABLE_SPOTIFY" ]]; then
echo "Spotify is disabled, exiting..."
Expand All @@ -11,8 +11,8 @@ fi
SOUND_DEVICE_NAME=${SOUND_DEVICE_NAME:-"balenaSound Spotify $(echo "$BALENA_DEVICE_UUID" | cut -c -4)"}
SOUND_SPOTIFY_BITRATE=${SOUND_SPOTIFY_BITRATE:-160}

# SOUND_SPOTIFY_DISABLE_NORMALISATION: Disable volume normalisation
if [[ -z "$SOUND_SPOTIFY_DISABLE_NORMALISATION" ]]; then
# SOUND_SPOTIFY_DISABLE_NORMALISATION: Disable volume normalization
if [[ -z ${SOUND_SPOTIFY_DISABLE_NORMALISATION+x} ]]; then
set -- "$@" \
--enable-volume-normalisation
fi
Expand All @@ -25,8 +25,8 @@ if [[ -n "$SOUND_SPOTIFY_USERNAME" ]] && [[ -n "$SOUND_SPOTIFY_PASSWORD" ]]; the
--password "$SOUND_SPOTIFY_PASSWORD"
fi

# SOUND_SPOTIFY_DISABLE_CACHE: Disable Spotify audio cache
if [[ -z "$SOUND_SPOTIFY_ENABLE_CACHE" ]]; then
# SOUND_SPOTIFY_ENABLE_CACHE: Enable Spotify audio cache
if [[ -z ${SOUND_SPOTIFY_ENABLE_CACHE+x} ]]; then
set -- "$@" \
--disable-audio-cache
fi
Expand All @@ -36,8 +36,8 @@ fi
echo "Starting Spotify plugin..."
echo "Device name: $SOUND_DEVICE_NAME"
[[ -n "$SOUND_SPOTIFY_USERNAME" ]] && [[ -n "$SOUND_SPOTIFY_PASSWORD" ]] && echo "Using provided credentials for Spotify login."
[[ -z "$SOUND_SPOTIFY_DISABLE_NORMALISATION" ]] && echo "Volume normalization enabled."
[[ -z "$SOUND_SPOTIFY_ENABLE_CACHE" ]] && echo "Spotify audio cache disabled."
[[ -n ${SOUND_SPOTIFY_DISABLE_NORMALISATION+x} ]] && echo "Volume normalization disabled."
[[ -n ${SOUND_SPOTIFY_ENABLE_CACHE+x} ]] && echo "Spotify audio cache enabled."

set -- /usr/bin/librespot \
--backend pulseaudio \
Expand Down

0 comments on commit b245f12

Please sign in to comment.