@serialized
    def add_tracks(self, tracks, index=None):
        """Add the given ``tracks`` to playlist at the given ``index``.

        ``tracks`` can either be a single :class:`~spotify.Track` or a list of
        :class:`~spotify.Track` objects. If ``index`` isn't specified, the
        tracks are added to the end of the playlist.
        """
        if isinstance(tracks, spotify.Track):
            tracks = [tracks]
        if index is None:
            index = len(self.tracks)
        spotify.Error.maybe_raise(lib.sp_playlist_add_tracks(
            self._sp_playlist, [t._sp_track for t in tracks], len(tracks),
            index, self._session._sp_session))
dataset/ETHPy150Open mopidy/pyspotify/spotify/playlist.py/Playlist.add_tracks/original