def _add_track(self, track):
        if not isinstance(track, models.Track):
            raise TypeError('Only Track objects can be added to the history')

        timestamp = int(time.time() * 1000)

        name_parts = []
        if track.artists:
            name_parts.append(
                ', '.join([artist.name for artist in track.artists]))
        if track.name is not None:
            name_parts.append(track.name)
        name = ' - '.join(name_parts)
        ref = models.Ref.track(uri=track.uri, name=name)

        self._history.insert(0, (timestamp, ref))
Add track to the playback history.
dataset/ETHPy150Open mopidy/mopidy/mopidy/core/history.py/HistoryController._add_track