Skip to content

Commit

Permalink
Release v0.6.3 Better log for DLNA renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Sep 14, 2021
1 parent c03fdf7 commit b05a26d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion macast/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.61
0.63
8 changes: 4 additions & 4 deletions macast/macast.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def GET(self, param=None):
return "hello world {}".format(param).encode()

def POST(self, service, param):
length = cherrypy.request.headers['Content-Length']
rawbody = cherrypy.request.body.read(int(length))
logger.debug('RAW: {}'.format(rawbody))
if param == 'action':
length = cherrypy.request.headers['Content-Length']
rawbody = cherrypy.request.body.read(int(length))
logger.debug(rawbody)
res = cherrypy.engine.publish('call_render', rawbody).pop()
cherrypy.response.headers['EXT'] = ''
logger.debug(res)
logger.debug('RES: {}'.format(res))
return res
return b''

Expand Down
7 changes: 5 additions & 2 deletions macast/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ def call(self, rawbody):
output = self.action_list[service][action].output
for arg in output:
res[arg.name] = self.state_list[arg.state].value
if method not in ['ConnectionManager_GetProtocolInfo', 'AVTransport_GetPositionInfo']:
logger.info("{}res: {}".format("*" * 20, res))
else:
logger.info("{}res: {}".format("*" * 20, method))

# build response xml
ns = 'http://schemas.xmlsoap.org/soap/envelope/'
Expand Down Expand Up @@ -551,8 +555,7 @@ def set_state_duration(self, data):
self.set_state('CurrentMediaDuration', data)

def set_state_transport(self, data):
"""data : string in [PLAYING, PAUSED_PLAYBACK, STOPPED,
NO_MEDIA_PRESENT, TRANSITIONING]
"""data : string in [PLAYING, PAUSED_PLAYBACK, STOPPED, NO_MEDIA_PRESENT]
"""
self.set_state('TransportState', data)
self.set_state('TransportStatus', 'OK')
Expand Down

0 comments on commit b05a26d

Please sign in to comment.