@staticmethod
def _play(sonos, data_type, results, *args):
    """
        Helper method for `_search_and_play` that handles
        adding and replacing of music information objects into
        a queue.

        There are a few different ways to call it:

            _play(sonos, 'artists', results, 'add', 3)

        Will add the item by index 3 from collection `results`
        into the queue.

            _play(sonos, 'artists', items, 'replace', 4)

        Will replace the current queue with the item by index 4 from
        collection `items`.
        """
    action, number = args[1:]
    if action not in ['add', 'replace']:
        message = "'Action must be one of 'add' or 'replace'"
        raise ValueError(message)
    try:
        number = int(number) - 1
    except ValueError:
        raise ValueError('Play number must be parseable as integer')
    if number not in range(len(results)):
        if len(results) == 0:
            message = 'No results to play from'
        elif len(results) == 1:
            message = 'Play number can only be 1'
        else:
            message = 'Play number has to be within the range 1 to {}'.format(
                len(results))
        raise ValueError(message)
    item = results[number]
    out = "Added {} to queue: '{}'"
    if action == 'replace':
        sonos.clear_queue()
        out = "Queue replaced with {}: '{}'"
    sonos.add_to_queue(item)
    title = item.title
    if hasattr(title, 'decode'):
        title = title.encode('utf-8')
    return out.format(data_type, title)
