Formatted code better and added TODO
This commit is contained in:
parent
30c95f3e9d
commit
4d9fbaf216
2 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,7 @@ class EventDrainer(Loggable):
|
||||||
"""
|
"""
|
||||||
def __init__(self, connection, interval=1):
|
def __init__(self, connection, interval=1):
|
||||||
def cb():
|
def cb():
|
||||||
|
# TODO : make 0.3 parameter configurable
|
||||||
try : connection.drain_events(timeout=0.3)
|
try : connection.drain_events(timeout=0.3)
|
||||||
except socket.timeout : pass
|
except socket.timeout : pass
|
||||||
except Exception as e :
|
except Exception as e :
|
||||||
|
|
|
@ -163,9 +163,12 @@ class Metadata(Loggable):
|
||||||
# Forcing the unicode through
|
# Forcing the unicode through
|
||||||
try : fpath = fpath.decode("utf-8")
|
try : fpath = fpath.decode("utf-8")
|
||||||
except : pass
|
except : pass
|
||||||
|
|
||||||
if not mmp.file_playable(fpath): raise BadSongFile(fpath)
|
if not mmp.file_playable(fpath): raise BadSongFile(fpath)
|
||||||
|
|
||||||
try : full_mutagen = mutagen.File(fpath, easy=True)
|
try : full_mutagen = mutagen.File(fpath, easy=True)
|
||||||
except Exception : raise BadSongFile(fpath)
|
except Exception : raise BadSongFile(fpath)
|
||||||
|
|
||||||
self.path = fpath
|
self.path = fpath
|
||||||
if not os.path.exists(self.path):
|
if not os.path.exists(self.path):
|
||||||
self.logger.info("Attempting to read metadata of file \
|
self.logger.info("Attempting to read metadata of file \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue