adapt is_url checking for bytestring paths

This commit is contained in:
Johnny Robeson 2016-06-16 23:59:51 -04:00
parent 1088df7242
commit 12136e1d32

View file

@ -40,9 +40,10 @@ mpd_config = config['mpd']
def is_url(path):
"""Try to determine if the path is an URL.
"""
if isinstance(path, bytes): # if it's bytes, then it's a path
return False
return path.split('://', 1)[0] in ['http', 'https']
# Use the MPDClient internals to get unicode.
# see http://www.tarmack.eu/code/mpdunicode.py for the general idea
class MPDClient(mpd.MPDClient):