(request: WSGIRequest)
return HttpResponse("Updated credentials")
Update spotify credentials.
Update spotify credentials.
Update spotify credentials .
def set_spotify_credentials(request: WSGIRequest) -> HttpResponse:
    """Update spotify credentials."""
    username = request.POST.get("username")
    password = request.POST.get("password")
    client_id = request.POST.get("client_id")
    client_secret = request.POST.get("client_secret")

    if not username or not password or not client_id or not client_secret:
        return HttpResponseBadRequest("All fields are required")

    storage.set("spotify_username", username)
    storage.set("spotify_password", password)
    storage.set("spotify_client_id", client_id)
    storage.set("spotify_client_secret", client_secret)

    system.update_mopidy_config("pulse")
    return HttpResponse("Updated credentials")
def set_spotify_credentials ( request : WSGIRequest ) -> HttpResponse : username = request . POST . get ( "username" ) password = request . POST . get ( "password" ) client_id = request . POST . get ( "client_id" ) client_secret = request . POST . get ( "client_secret" ) if not username or not password or not client_id or not client_secret : return HttpResponseBadRequest ( "All fields are required" ) storage . set ( "spotify_username" , username ) storage . set ( "spotify_password" , password ) storage . set ( "spotify_client_id" , client_id ) storage . set ( "spotify_client_secret" , client_secret ) system . update_mopidy_config ( "pulse" ) return HttpResponse ( "Updated credentials" )