diff --git a/misc/sampleconfigs/mopidy-etc.sample b/misc/sampleconfigs/mopidy.conf.sample similarity index 100% rename from misc/sampleconfigs/mopidy-etc.sample rename to misc/sampleconfigs/mopidy.conf.sample diff --git a/misc/sampleconfigs/mopidy.sample b/misc/sampleconfigs/mopidy.sample deleted file mode 100644 index 7ce7c7bd6..000000000 --- a/misc/sampleconfigs/mopidy.sample +++ /dev/null @@ -1,159 +0,0 @@ -# For further information about options in this file see: -# http://docs.mopidy.com/ -# -# The initial commented out values reflect the defaults as of: -# Mopidy 2.2.0 -# Mopidy-File 2.2.0 -# Mopidy-HTTP 2.2.0 -# Mopidy-Iris 3.27.1 -# Mopidy-Local 2.2.0 -# Mopidy-Local-Images 1.0.0 -# Mopidy-M3U 2.2.0 -# Mopidy-MPD 2.2.0 -# Mopidy-SoftwareMixer 2.2.0 -# Mopidy-Spotify 3.1.0 -# Mopidy-Stream 2.2.0 -# -# Available options and defaults might have changed since then, -# run `mopidy config` to see the current effective config and -# `mopidy --version` to check the current version. - -[core] -cache_dir = $XDG_CACHE_DIR/mopidy -config_dir = $XDG_CONFIG_DIR/mopidy -data_dir = $XDG_DATA_DIR/mopidy -max_tracklist_length = 10000 -restore_state = false - -[logging] -#color = true -#console_format = %(levelname)-8s %(message)s -#debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s -#debug_file = mopidy.log -#config_file = - -[audio] -#mixer = software -mixer_volume = 30 -output = alsasink -#buffer_time = - -[proxy] -#scheme = -#hostname = -#port = -#username = -#password = - -[local-images] -#enabled = true -#library = json -#base_uri = /images/ -#image_dir = -#album_art_files = -# *.jpg -# *.jpeg -# *.png - -[iris] -#enabled = true -country = DE -locale = de_DE -#spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php -#lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php -#genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php -#snapcast_enabled = false -#snapcast_host = localhost -#snapcast_port = 1705 - -[mpd] -#enabled = true -hostname = 0.0.0.0 -#port = 6600 -#password = -#max_connections = 20 -#connection_timeout = 60 -#zeroconf = Mopidy MPD server on $hostname -#command_blacklist = -# listall -# listallinfo -#default_playlist_scheme = m3u - -[http] -#enabled = true -hostname = 0.0.0.0 -#port = 6680 -#static_dir = -#zeroconf = Mopidy HTTP server on $hostname -#allowed_origins = - -[stream] -#enabled = true -#protocols = -# http -# https -# mms -# rtmp -# rtmps -# rtsp -#metadata_blacklist = -#timeout = 5000 - -[m3u] -#enabled = true -#base_dir = $XDG_MUSIC_DIR -default_encoding = UTF-8 -default_extension = .m3u -playlists_dir = /home/pi/RPi-Jukebox-RFID/playlists - -[softwaremixer] -#enabled = true - -[file] -#enabled = true -#media_dirs = -# $XDG_MUSIC_DIR|Music -# ~/|Home -#excluded_file_extensions = -# .jpg -# .jpeg -#show_dotfiles = false -#follow_symlinks = false -metadata_timeout = 1 - -[local] -enabled = true -#library = json -media_dir = %DIRaudioFolders% -#scan_timeout = 1000 -#scan_flush_threshold = 100 -#scan_follow_symlinks = false -excluded_file_extensions = -# .directory -# .html -# .jpeg - .jpg -# .log -# .nfo -# .png - .txt - .conf - placeholder - -[spotify] -enabled = true -username = %spotify_username% -password = %spotify_password% -client_id = %spotify_client_id% -client_secret = %spotify_client_secret% -#bitrate = 160 -#volume_normalization = true -#private_session = false -#timeout = 10 -#allow_cache = true -#allow_network = true -#allow_playlists = true -#search_album_count = 20 -#search_artist_count = 10 -#search_track_count = 50 -#toplist_countries = diff --git a/scripts/installscripts/install-jukebox.sh b/scripts/installscripts/install-jukebox.sh index 35adea368..40ae1a031 100644 --- a/scripts/installscripts/install-jukebox.sh +++ b/scripts/installscripts/install-jukebox.sh @@ -1095,8 +1095,7 @@ 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 @@ -1104,23 +1103,12 @@ install_main() { 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 diff --git a/scripts/installscripts/tests/test_installation.sh b/scripts/installscripts/tests/test_installation.sh index 79ea2d4fd..69ee54da7 100755 --- a/scripts/installscripts/tests/test_installation.sh +++ b/scripts/installscripts/tests/test_installation.sh @@ -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}"