More logging improvements.
This commit is contained in:
parent
1de449fe0c
commit
d3df33ecf0
3 changed files with 9 additions and 10 deletions
|
@ -346,7 +346,7 @@ class MyRadioAPI:
|
|||
self._log("Not tracklisting, {} is not a track.".format(item.name))
|
||||
return False
|
||||
|
||||
self._log("Tracklisting item: {}".format(item.name))
|
||||
self._log("Tracklisting item: '{}'".format(item.name))
|
||||
|
||||
source: str = self.config.get()["myradio_api_tracklist_source"]
|
||||
data = {
|
||||
|
|
|
@ -166,8 +166,7 @@ class StateManager:
|
|||
if not allow:
|
||||
|
||||
# Just some debug logging.
|
||||
if update_file and (key not in ["playing", "loaded", "initialised"]):
|
||||
self._log("Key: {},\nnew:{}\nold:{}, ".format(key, getattr(value, "__dict__", None), getattr(state_to_update[key], "__dict__", None)), DEBUG)
|
||||
if update_file and (key not in ["playing", "loaded", "initialised", "remaining", "pos_true"]):
|
||||
self._log("Not updating state for key '{}' with value '{}' of type '{}'.".format(key, value, type(value)), DEBUG)
|
||||
|
||||
# We're trying to update the state with the same value.
|
||||
|
|
14
player.py
14
player.py
|
@ -659,9 +659,9 @@ class Player:
|
|||
self.logger.log.info("No tracklist to end.")
|
||||
return
|
||||
|
||||
self.logger.log.info("Setting timer for ending tracklist_id {}".format(tracklist_id))
|
||||
self.logger.log.info("Setting timer for ending tracklist_id '{}'".format(tracklist_id))
|
||||
if tracklist_id:
|
||||
self.logger.log.info("Attempting to end tracklist_id {}".format(tracklist_id))
|
||||
self.logger.log.info("Attempting to end tracklist_id '{}'".format(tracklist_id))
|
||||
if self.tracklist_end_timer:
|
||||
self.logger.log.error("Failed to potentially end tracklist, timer already busy.")
|
||||
return
|
||||
|
@ -688,15 +688,15 @@ class Player:
|
|||
if (state["tracklist_mode"] == "fader-live" and not state["live"]):
|
||||
self.logger.log.info("Not tracklisting since fader is not live.")
|
||||
else:
|
||||
self.logger.log.info("Tracklisting item: {}".format(loaded_item.name))
|
||||
self.logger.log.info("Tracklisting item: '{}'".format(loaded_item.name))
|
||||
tracklist_id = self.api.post_tracklist_start(loaded_item)
|
||||
if not tracklist_id:
|
||||
self.logger.log.warning("Failed to tracklist {}".format(loaded_item.name))
|
||||
self.logger.log.warning("Failed to tracklist '{}'".format(loaded_item.name))
|
||||
else:
|
||||
self.logger.log.info("Tracklist id: {}".format(tracklist_id))
|
||||
self.logger.log.info("Tracklist id: '{}'".format(tracklist_id))
|
||||
self.state.update("tracklist_id", tracklist_id)
|
||||
else:
|
||||
self.logger.log.info("Not tracklisting item {}, already got tracklistid: {}".format(
|
||||
self.logger.log.info("Not tracklisting item '{}', already got tracklistid: '{}'".format(
|
||||
loaded_item.name, tracklist_id))
|
||||
|
||||
# No matter what we end up doing, we need to kill this timer so future ones can run.
|
||||
|
@ -705,7 +705,7 @@ class Player:
|
|||
def _tracklist_end(self, tracklist_id):
|
||||
|
||||
if tracklist_id:
|
||||
self.logger.log.info("Attempting to end tracklist_id {}".format(tracklist_id))
|
||||
self.logger.log.info("Attempting to end tracklist_id '{}'".format(tracklist_id))
|
||||
self.api.post_tracklist_end(tracklist_id)
|
||||
else:
|
||||
self.logger.log.error("Tracklist_id to _tracklist_end() missing. Failed to end tracklist.")
|
||||
|
|
Loading…
Reference in a new issue