'Add tracks to the tracklist.
If ``uri`` is given instead of ``tracks``, the URI is looked up in the
library and the resulting tracks are added to the tracklist.
If ``uris`` is given instead of ``uri`` or ``tracks``, the URIs are
looked up in the library and the resulting tracks are added to the
tracklist.
If ``at_position`` is given, the tracks are inserted at the given
position in the tracklist. If ``at_position`` is not given, the tracks
are appended to the end of the tracklist.
Triggers the :meth:`mopidy.core.CoreListener.tracklist_changed` event.
:param tracks: tracks to add
:type tracks: list of :class:`mopidy.models.Track` or :class:`None`
:param at_position: position in tracklist to add tracks
:type at_position: int or :class:`None`
:param uri: URI for tracks to add
:type uri: string or :class:`None`
:param uris: list of URIs for tracks to add
:type uris: list of string or :class:`None`
:rtype: list of :class:`mopidy.models.TlTrack`
.. versionadded:: 1.0
The ``uris`` argument.
.. deprecated:: 1.0
The ``tracks`` and ``uri`` arguments. Use ``uris``.'

def add(self, tracks=None, at_position=None, uri=None, uris=None):

    if (sum(((o is not None) for o in [tracks, uri, uris])) != 1):
        raise ValueError(u'Exactly    one    of    "tracks",    "uri"    or    "uris"    must    be    set')
    ((tracks is None) or validation.check_instances(tracks, Track))
    ((uri is None) or validation.check_uri(uri))
    ((uris is None) or validation.check_uris(uris))
    validation.check_integer((at_position or 0))
    if tracks:
        deprecation.warn(u'core.tracklist.add:tracks_arg')
    if uri:
        deprecation.warn(u'core.tracklist.add:uri_arg')
    if (tracks is None):
        if (uri is not None):
            uris = [uri]
        tracks = []
        track_map = self.core.library.lookup(uris=uris)
        for uri in uris:
            tracks.extend(track_map[uri])
    tl_tracks = []
    max_length = self.core._config[u'core'][u'max_tracklist_length']
    for track in tracks:
        if (self.get_length() >= max_length):
            raise exceptions.TracklistFull((u'Tracklist    may    contain    at    most    %d    tracks.' % max_length))
        tl_track = TlTrack(self._next_tlid, track)
        self._next_tlid += 1
        if (at_position is not None):
            self._tl_tracks.insert(at_position, tl_track)
            at_position += 1
        else:
            self._tl_tracks.append(tl_track)
        tl_tracks.append(tl_track)
    if tl_tracks:
        self._increase_version()
    return tl_tracks
