Skip to content

Commit

Permalink
<UNDER CONSTRUCTION> Correct status call in webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovylein committed May 2, 2024
1 parent b4ff177 commit 83692f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ async def _status_listener(self):
# logger.debug("MPD: Idle change in", subsystem)
s = await self.client.status()
# logger.debug(f"MPD: New Status: {s.result()}")
#print(f"MPD: New Status: {type(s)} // {s}")
# print(f"MPD: New Status: {type(s)} // {s}")
# Now, do something with it ...
publishing.get_publisher().send('playerstatus', s)


async def _status(self):
return await self.client.status()

Expand Down
3 changes: 2 additions & 1 deletion src/jukebox/components/player/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def __init__(self):
def _status_poll(self):
ret_status = self._active.status()
if ret_status.get('state') == 'play':
self.player_status.update(playing=True, elapsed=ret_status.get('elapsed', '0.0'), duration=ret_status.get('duration', '0.0') )
self.player_status.update(playing=True, elapsed=ret_status.get('elapsed', '0.0'),
duration=ret_status.get('duration', '0.0'))

def register(self, name: str, backend):
self._backends[name] = backend
Expand Down
2 changes: 1 addition & 1 deletion src/jukebox/components/player/core/player_status.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

import jukebox.plugs as plugin
from jukebox import publishing, multitimer
from jukebox import publishing

logger = logging.getLogger('jb.player')

Expand Down
2 changes: 1 addition & 1 deletion src/webapp/src/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const commands = {
},
playerstatus: {
_package: 'player',
plugin: 'playerstatus',
plugin: 'player_status',
method: 'status'
},

Expand Down

0 comments on commit 83692f1

Please sign in to comment.