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: save_tracks_worker.rb
    path of file: ./repos/plylst/app/workers
    
    the code of the file until where you have to start completion: class SaveTracksWorker
  include Sidekiq::Worker

  sidekiq_options lock: :while_executing, on_conflict: :reject

  def perform(us
    
  def perform(user_id, tracks_with_date, kind = 'added')
    # Find user these tracks are associated with, if a user_id is passed
    user = User.find user_id if user_id.present?
    audio_feature_ids = Array.new

    # Check if `tracks_with_date` is actually a multi-dimensional array (meaning it has dates)
    if tracks_with_date.all? { |e| e.kind_of? Array }
      tracks_with_date = tracks_with_date.delete_if { |elem| elem[0] == nil }
      track_ids = tracks_with_date.map(&:first)
    else
      track_ids = tracks_with_date
    end