'Add track to the playback history.
Internal method for :class:`mopidy.core.PlaybackController`.
:param track: track to add
:type track: :class:`mopidy.models.Track`'

def _add_track(self, track):

    if (not isinstance(track, models.Track)):
        raise TypeError(u'Only    Track    objects    can    be    added    to    the    history')
    timestamp = int((time.time() * 1000))
    name_parts = []
    if track.artists:
        name_parts.append(u',    '.join([artist.name for artist in track.artists]))
    if (track.name is not None):
        name_parts.append(track.name)
    name = u'    -    '.join(name_parts)
    ref = models.Ref.track(uri=track.uri, name=name)
    self._history.insert(0, (timestamp, ref))
