コード例 #1
0
 def checkVideoActivation(self, infoTag):
     try:
         duration = infoTag.getDuration(
         ) / 60  # returns seconds, convert to minutes
         mediaType = infoTag.getMediaType()
         fileName = infoTag.getFile()
         logger.debug(
             "InfoTag contents: duration: {}, mediaType: {}, file: {}".
             format(duration, mediaType, fileName))
     except AttributeError:
         logger.exception("Can't read infoTag")
         return False
     logger.debug(
         "Video Activation settings({}): minDuration: {}, Movie: {}, Episode: {}, MusicVideo: {}, Other: {}"
         .format(self.kgroupID, settings_storage['videoMinimumDuration'],
                 settings_storage['video_enableMovie'],
                 settings_storage['video_enableEpisode'],
                 settings_storage['video_enableMusicVideo'],
                 settings_storage['video_enableOther']))
     logger.debug(
         "Video Activation ({}): Duration: {}, mediaType: {}".format(
             self.kgroupID, duration, mediaType))
     if (duration > settings_storage['videoMinimumDuration'] and (
         (settings_storage['video_enableMovie'] and mediaType == "movie") or
         (settings_storage['video_enableEpisode']
          and mediaType == "episode") or
         (settings_storage['video_enableMusicVideo']
          and mediaType == "MusicVideo"))
             or settings_storage['video_enableOther']):
         logger.debug("Video activation: True")
         return True
     logger.debug("Video activation: False")
     return False
コード例 #2
0
    def checkVideoActivation(self, infoTag):
        try:
            duration = infoTag.getDuration(
            ) / 60  # returns seconds, convert to minutes
            mediaType = infoTag.getMediaType()
            fileName = infoTag.getFile()
            if not fileName and self.isPlayingVideo():
                fileName = self.getPlayingFile()

            if not fileName and settings_storage['previousFileName']:
                fileName = settings_storage['previousFileName']
            elif fileName:
                settings_storage['previousFileName'] = fileName

            logger.debug(
                "InfoTag contents: duration: {}, mediaType: {}, file: {}".
                format(duration, mediaType, fileName))
        except AttributeError:
            logger.exception("Can't read infoTag")
            return False
        logger.debug(
            "Video Activation settings({}): minDuration: {}, Movie: {}, Episode: {}, MusicVideo: {}, PVR : {}, Other: {}"
            .format(self.kgroupID, settings_storage['videoMinimumDuration'],
                    settings_storage['video_enableMovie'],
                    settings_storage['video_enableEpisode'],
                    settings_storage['video_enableMusicVideo'],
                    settings_storage['video_enablePVR'],
                    settings_storage['video_enableOther']))
        logger.debug(
            "Video Activation ({}): Duration: {}, mediaType: {}, ispvr: {}".
            format(self.kgroupID, duration, mediaType, fileName[0:3] == "pvr"))
        if ((duration >= settings_storage['videoMinimumDuration']
             or fileName[0:3] == "pvr") and
            ((settings_storage['video_enableMovie'] and mediaType == "movie")
             or (settings_storage['video_enableEpisode']
                 and mediaType == "episode") or
             (settings_storage['video_enableMusicVideo']
              and mediaType == "MusicVideo") or
             (settings_storage['video_enablePVR'] and fileName[0:3] == "pvr")
             or (settings_storage['video_enableOther'] and mediaType != "movie"
                 and mediaType != "episode" and mediaType != "MusicVideo"
                 and fileName[0:3] != "pvr"))):
            logger.debug("Video activation: True")
            return True
        logger.debug("Video activation: False")
        return False
コード例 #3
0
# -*- coding: utf-8 -*-

from resources.lib import core, logger, ADDONVERSION, KODIVERSION
from resources.lib import reporting

logger.info("Starting service.py, version {}, Kodi: {}".format(
    ADDONVERSION, KODIVERSION))
try:
    core.core()  #Run Hue service
except Exception as exc:
    logger.exception("Core service exception")
    reporting.process_exception(exc)

logger.info("Shutting down service.py, version {}, Kodi: {}".format(
    ADDONVERSION, KODIVERSION))
コード例 #4
0
# -*- coding: utf-8 -*-

from resources.lib import menu, logger, ADDONVERSION, KODIVERSION, reporting

logger.info("*** Starting plugin.py, version {}, Kodi: {}".format(
    ADDONVERSION, KODIVERSION))
try:
    menu.menu()  # Run menu
except Exception as exc:
    logger.exception("Command exception")
    reporting.process_exception(exc)
logger.info("*** Shutting down plugin.py, version {}, Kodi: {}".format(
    ADDONVERSION, KODIVERSION))