appendPlaylists function