Skip to content

Commit

Permalink
fix: removed unnecessary mopidy user conf
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Apr 2, 2024
1 parent c73b6b8 commit 35ca121
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 185 deletions.
File renamed without changes.
159 changes: 0 additions & 159 deletions misc/sampleconfigs/mopidy.sample

This file was deleted.

24 changes: 6 additions & 18 deletions scripts/installscripts/install-jukebox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1095,32 +1095,20 @@ install_main() {
# Spotify config
if [ "${SPOTinstall}" == "YES" ]; then
echo "Configuring Spotify support..."
local etc_mopidy_conf="/etc/mopidy/mopidy.conf"
local mopidy_conf="${HOME_DIR}/.config/mopidy/mopidy.conf"
local mopidy_conf="/etc/mopidy/mopidy.conf"
sudo systemctl disable mpd
sudo service mpd stop
sudo systemctl enable mopidy
# Install Config Files
sudo cp "${jukebox_dir}"/misc/sampleconfigs/locale.gen.sample /etc/locale.gen
sudo cp "${jukebox_dir}"/misc/sampleconfigs/locale.sample /etc/default/locale
sudo locale-gen
mkdir -p "${HOME_DIR}"/.config/mopidy
sudo cp "${jukebox_dir}"/misc/sampleconfigs/mopidy-etc.sample "${etc_mopidy_conf}"
cp "${jukebox_dir}"/misc/sampleconfigs/mopidy.sample "${mopidy_conf}"
sudo cp "${jukebox_dir}"/misc/sampleconfigs/mopidy.conf.sample "${mopidy_conf}"
# Change vars to match install config
sudo sed -i 's/%spotify_username%/'"$SPOTIuser"'/' "${etc_mopidy_conf}"
sudo sed -i 's/%spotify_password%/'"$SPOTIpass"'/' "${etc_mopidy_conf}"
sudo sed -i 's/%spotify_client_id%/'"$SPOTIclientid"'/' "${etc_mopidy_conf}"
sudo sed -i 's/%spotify_client_secret%/'"$SPOTIclientsecret"'/' "${etc_mopidy_conf}"
# for $DIRaudioFolders using | as alternate regex delimiter because of the folder path slash
sudo sed -i 's|%DIRaudioFolders%|'"$DIRaudioFolders"'|' "${etc_mopidy_conf}"
# Replace homedir; double quotes for variable expansion
sudo sed -i "s%/home/pi%${HOME_DIR}%g" "${etc_mopidy_conf}"

sed -i 's/%spotify_username%/'"$SPOTIuser"'/' "${mopidy_conf}"
sed -i 's/%spotify_password%/'"$SPOTIpass"'/' "${mopidy_conf}"
sed -i 's/%spotify_client_id%/'"$SPOTIclientid"'/' "${mopidy_conf}"
sed -i 's/%spotify_client_secret%/'"$SPOTIclientsecret"'/' "${mopidy_conf}"
sudo sed -i 's/%spotify_username%/'"$SPOTIuser"'/' "${mopidy_conf}"
sudo sed -i 's/%spotify_password%/'"$SPOTIpass"'/' "${mopidy_conf}"
sudo sed -i 's/%spotify_client_id%/'"$SPOTIclientid"'/' "${mopidy_conf}"
sudo sed -i 's/%spotify_client_secret%/'"$SPOTIclientsecret"'/' "${mopidy_conf}"
# for $DIRaudioFolders using | as alternate regex delimiter because of the folder path slash
sudo sed -i 's|%DIRaudioFolders%|'"$DIRaudioFolders"'|' "${mopidy_conf}"
# Replace homedir; double quotes for variable expansion
Expand Down
9 changes: 1 addition & 8 deletions scripts/installscripts/tests/test_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -425,17 +425,10 @@ verify_systemd_services() {

verify_spotify_config() {
if [[ "${SPOTinstall}" == "YES" ]]; then
local etc_mopidy_conf="/etc/mopidy/mopidy.conf"
local mopidy_conf="${HOME_DIR}/.config/mopidy/mopidy.conf"
local mopidy_conf="/etc/mopidy/mopidy.conf"

printf "\nTESTING spotify config...\n\n"

check_file_contains_string "username = ${SPOTIuser}" "${etc_mopidy_conf}"
check_file_contains_string "password = ${SPOTIpass}" "${etc_mopidy_conf}"
check_file_contains_string "client_id = ${SPOTIclientid}" "${etc_mopidy_conf}"
check_file_contains_string "client_secret = ${SPOTIclientsecret}" "${etc_mopidy_conf}"
check_file_contains_string "media_dir = ${DIRaudioFolders}" "${etc_mopidy_conf}"

check_file_contains_string "username = ${SPOTIuser}" "${mopidy_conf}"
check_file_contains_string "password = ${SPOTIpass}" "${mopidy_conf}"
check_file_contains_string "client_id = ${SPOTIclientid}" "${mopidy_conf}"
Expand Down

0 comments on commit 35ca121

Please sign in to comment.