You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: playlists_controller.rb
    path of file: ./repos/alonetone/app/controllers
    
    the code of the file until where you have to start completion: class PlaylistsController < ApplicationController
  include Listens

  before_action :find_user, except: :all
    
  def update
    is_private = params[:playlist].delete(:is_private)
    if @playlist.update(playlist_params)
      @playlist.is_private = is_private
      redirect_to edit_user_playlist_path(@user, @playlist), notice: 'Playlist was successfully updated.'
    else
      set_assets
      render action: "edit"
    end