def getConnectTime(addon):
# Get the connection time from the settings or use a default
t = addon.getSetting("last_connect_time")
if not t.isdigit():
# Return the Kodi build time or the time I just wrote this in Feb '17, whichever is more recent
# Expecting a %m %d %Y format date here but will just grab the year and not do time
# formatting because I don't know what Kodi will do to the month in different locales
seconds = 0
try:
build_date = xbmc.getInfoLabel("System.BuildDate")
seconds = (int(build_date[-4:]) - 1970) * 31557600
except:
# In case the formatting of the build date changess
pass
vpn_mgr_time = 1487116800
if seconds < vpn_mgr_time:
seconds = vpn_mgr_time
return seconds
else:
return int(t)
评论列表
文章目录