forked from trakt/script.trakt
-
Notifications
You must be signed in to change notification settings - Fork 18
/
default.py
26 lines (22 loc) · 828 Bytes
/
default.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
#
import logging
import xbmcaddon
from resources.lib import kodilogging
from resources.lib.service import traktService
from resources.lib.utilities import createError, checkIfNewVersion
from resources.lib.kodiUtilities import setSetting, getSetting
__addon__ = xbmcaddon.Addon('script.trakt')
__addonversion__ = __addon__.getAddonInfo('version')
__addonid__ = __addon__.getAddonInfo('id')
kodilogging.config()
logger = logging.getLogger(__name__)
logger.debug("Loading '%s' version '%s'" % (__addonid__, __addonversion__))
if checkIfNewVersion(str(getSetting('version')), str(__addonversion__)):
setSetting('version', __addonversion__)
try:
traktService().run()
except Exception as ex:
message = createError(ex)
logger.fatal(message)
logger.debug("'%s' shutting down." % __addonid__)