'Searches the playlist for a song with the given id and
returns its index in the playlist.'

def _id_to_index(self, track_id):

    track_id = cast_arg(int, track_id)
    for (index, track) in enumerate(self.playlist):
        if (self._item_id(track) == track_id):
            return index
    raise ArgumentNotFoundError()
