Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
cast to string
Browse files Browse the repository at this point in the history
  • Loading branch information
hanss314 committed Jan 14, 2018
1 parent 5752f78 commit d0cc136
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions musicbot/cogs/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def __init__(self, bot):
self.bot = bot

async def get_queue(self, request):
gid = int(request.match_info.get('id', '0'))
gid = int(request.match_info.get('guild_id', '0'))
queue = [{
'title': player.title,
'duration': player.duration,
'user': player.user.name if player.user else 'Autoplaylist',
'id': hashlib.sha1((player.title+(player.user or '')).encode('utf-8')).hexdigest(),
'id': hashlib.sha1((player.title+str(player.user or '')).encode('utf-8')).hexdigest(),
} for player in self.bot.queues[gid]]
if queue:
queue[0]['time'] = int(time.time()-self.bot.queues[gid][0].start_time)
Expand Down Expand Up @@ -70,7 +70,7 @@ async def authorize(self, request):
async def on_ready(self):
app = web.Application()
app.router.add_get('/authorize/{guild_id}/{user_id}', self.authorize)
app.router.add_get('/{id}/playlist', self.get_queue)
app.router.add_get('/{guild_id}/playlist', self.get_queue)
app.router.add_delete('/{guild_id}', self.skip)
handler = app.make_handler()
f = self.bot.loop.create_server(handler, '127.0.0.1', '8088')
Expand Down

0 comments on commit d0cc136

Please sign in to comment.