Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
Misc fixes (#53)
Browse files Browse the repository at this point in the history
* Fix a Python3 compatibility

* Small fixes

* [requirements] bump to youtube-dl 2017.8.23
  • Loading branch information
Malgnor authored and b1naryth1ef committed Aug 30, 2017
1 parent 95d10a3 commit c00befe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion disco/bot/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
TYPE_MAP = {
'str': lambda ctx, data: str(data) if six.PY3 else unicode(data),
'int': lambda ctx, data: int(data),
'float': lambda ctx, data: int(data),
'float': lambda ctx, data: float(data),
'snowflake': lambda ctx, data: int(data),
}

Expand Down
2 changes: 1 addition & 1 deletion disco/voice/playable.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def info(self):
if self._url:
obj = ydl.extract_info(self._url, download=False, process=False)
if 'entries' in obj:
self._ie_info = obj['entries'][0]
self._ie_info = list(obj['entries'])[0]
else:
self._ie_info = obj

Expand Down
7 changes: 4 additions & 3 deletions disco/voice/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ def pause(self):
self.events.emit(self.Events.PAUSE_PLAY)

def resume(self):
self.paused.set()
self.paused = None
self.events.emit(self.Events.RESUME_PLAY)
if self.paused:
self.paused.set()
self.paused = None
self.events.emit(self.Events.RESUME_PLAY)

def play(self, item):
# Grab the first frame before we start anything else, sometimes playables
Expand Down
2 changes: 2 additions & 0 deletions disco/voice/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ def __iter__(self):

def __nonzero__(self):
return True

__bool__ = __nonzero__
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'voice': ['pynacl==1.1.2'],
'http': ['flask==0.12.2'],
'yaml': ['pyyaml==3.12'],
'music': ['youtube_dl==2017.4.26'],
'music': ['youtube_dl>=2017.8.23'],
'performance': ['erlpack==0.3.2', 'ujson==1.35'],
'sharding': ['gipc==0.6.0'],
'docs': ['biblio==0.0.4'],
Expand Down

0 comments on commit c00befe

Please sign in to comment.