4 from mpdaio import MPDClient
7 logging.basicConfig(level=logging.INFO, format='%(levelname)-8s %(message)s')
8 logging.getLogger("asyncio").setLevel(logging.WARNING)
9 # debug level level will show where defaults settings come from
10 log = logging.getLogger('mpdaio.client')
11 log.setLevel(logging.DEBUG)
14 async def search(fltr):
16 await client.searchadd(fltr)
21 # Make an initial connection to MPD server
22 # The connection is kept open an reused for later commands
26 '(Artist == "Neurosis")',
28 '(Artist == "Cult of Luna")',
30 # Each task gathered here will run with it's own connection
31 await asyncio.gather(*map(search, filters))
33 # Closes all connections to MPD server
37 if __name__ == '__main__':
38 # Use defaults to access MPD server