Skip to content

Commit

Permalink
improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Snapcase committed Sep 6, 2019
1 parent b3e2e74 commit be91399
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion script.service.hue/addon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<addon id="script.service.hue" name="Hue Service" provider-name="zim514" version="0.7.13~dev4">
<addon id="script.service.hue" name="Hue Service" provider-name="zim514" version="0.7.13~dev5">
<requires>
<import addon="xbmc.python" version="2.26.0" />
<import addon="script.module.requests" version="2.22.0" />
Expand Down
10 changes: 8 additions & 2 deletions script.service.hue/resources/lib/KodiGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ def onAVStarted(self):
globals.lastMediaType = self.playbackType()

if self.isPlayingVideo() and self.mediaType == VIDEO: #If video group, check video activation. Otherwise it's audio so ignore this and check other conditions.
self.videoInfoTag=self.getVideoInfoTag()
try:
self.videoInfoTag=self.getVideoInfoTag()
except Exception as e:
logger.debug("Get InfoTag Exception: {}".format(e))
logger.debug("InfoTag: {}".format(self.videoInfoTag))
if not self.checkVideoActivation(self.videoInfoTag):
return
else:
Expand Down Expand Up @@ -175,10 +179,12 @@ def checkActiveTime(self):


def checkVideoActivation(self,infoTag):
logger.debug("InfoTag: {}".format(infoTag))
try:
logger.debug("InfoTag: {}".format(self.infoTag))
duration=infoTag.getDuration() / 60 #returns seconds, convert to minutes
mediaType=infoTag.getMediaType()
file=infoTag.getFile()
logger.debug("InfoTag contents: duration: {}, mediaType: {}, file: {}".format(duration,mediaType,file))
except AttributeError:
logger.exception("Can't read infoTag")
return False
Expand Down

0 comments on commit be91399

Please sign in to comment.