(output: str)
Updates mopidy's config with the credentials stored in the database.
    If no config_file is given, the default one is used.
Updates mopidy's config with the credentials stored in the database.
    If no config_file is given, the default one is used.
Updates mopidy s config with the credentials stored in the database . If no config_file is given the default one is used .
def update_mopidy_config(output: str) -> None:
    """Updates mopidy's config with the credentials stored in the database.
    If no config_file is given, the default one is used."""
    if settings.DOCKER:
        # raveberry cannot restart mopidy in the docker setup
        return

    if output == "pulse":
        if storage.get("feed_cava") and shutil.which("cava"):
            output = "cava"
        else:
            output = "regular"

    spotify_username = storage.get("spotify_username")
    spotify_password = storage.get("spotify_password")
    spotify_client_id = storage.get("spotify_client_id")
    spotify_client_secret = storage.get("spotify_client_secret")
    soundcloud_auth_token = storage.get("soundcloud_auth_token")
    jamendo_client_id = storage.get("jamendo_client_id")

    subprocess.call(
        [
            "sudo",
            "/usr/local/sbin/raveberry/update_mopidy_config",
            output,
            spotify_username,
            spotify_password,
            spotify_client_id,
            spotify_client_secret,
            soundcloud_auth_token,
            jamendo_client_id,
        ]
    )
    _restart_mopidy()
def update_mopidy_config ( output : str ) -> None : if settings . DOCKER : # raveberry cannot restart mopidy in the docker setup return if output == "pulse" : if storage . get ( "feed_cava" ) and shutil . which ( "cava" ) : output = "cava" else : output = "regular" spotify_username = storage . get ( "spotify_username" ) spotify_password = storage . get ( "spotify_password" ) spotify_client_id = storage . get ( "spotify_client_id" ) spotify_client_secret = storage . get ( "spotify_client_secret" ) soundcloud_auth_token = storage . get ( "soundcloud_auth_token" ) jamendo_client_id = storage . get ( "jamendo_client_id" ) subprocess . call ( [ "sudo" , "/usr/local/sbin/raveberry/update_mopidy_config" , output , spotify_username , spotify_password , spotify_client_id , spotify_client_secret , soundcloud_auth_token , jamendo_client_id , ] ) _restart_mopidy ( )