'List distinct values for a given field from the library.
This has mainly been added to support the list commands the MPD
protocol supports in a more sane fashion. Other frontends are not
recommended to use this method.
:param string field: One of ``track``, ``artist``, ``albumartist``,
``album``, ``composer``, ``performer``, ``date`` or ``genre``.
:param dict query: Query to use for limiting results, see
:meth:`search` for details about the query format.
:rtype: set of values corresponding to the requested field type.
.. versionadded:: 1.0'

def get_distinct(self, field, query=None):

    validation.check_choice(field, validation.DISTINCT_FIELDS)
    ((query is None) or validation.check_query(query))
    result = set()
    futures = {b: b.library.get_distinct(field, query) for b in self.backends.with_library.values()}
    for (backend, future) in futures.items():
        with _backend_error_handling(backend):
            values = future.get()
            if (values is not None):
                validation.check_instances(values, compat.text_type)
                result.update(values)
    return result
