-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdefault.py
82 lines (76 loc) · 2.26 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
############################################################################
# NHL GAMECENTER
# XBMC ADD-ON
############################################################################
import xbmcgui
from resources.lib.userinterface import *
from resources.lib.scoring_updates import *
params = get_params()
print params
try:
url=urllib.unquote_plus(params["url"])
except:
url=None
try:
mode = int(params['mode'])
except:
mode = None
print "Mode: "+str(mode)
print "URL: "+str(url)
if mode == None or url==None or len(url)<1:
CATEGORIES()
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 1:
LIVE(url)
#xbmcplugin.endOfDirectory(int(sys.argv[1]))
#Do Not Cache Menu
xbmcplugin.endOfDirectory(int(sys.argv[1]),1,0,0)
elif mode == 2:
LIVEQUALITY(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 3:
LIVELINKS(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 4:
ARCHIVE(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 5:
ARCHIVEMONTH(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 6:
ARCHIVEGAMES(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 7:
ARCHIVEQUALITY(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 8:
ARCHIVELINKS(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 9:
LASTNIGHT(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 10:
LASTNIGHTTYPE(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 11:
LATESTGAMES(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 12:
LATESTGQUALITY(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 13:
LATESTGLINKS(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 14:
LATESTGTYPE(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
elif mode == 100:
ADDON.setSetting(id='score_updates', value='true')
s = ScoreThread()
t = threading.Thread(target = s.Scoring_Updates)
t.start()
elif mode == 101:
dialog = xbmcgui.Dialog()
title = "Score Notifications"
dialog.notification(title, 'Stopping...', ADDON_PATH+'/resources/images/nhl_logo.png', 5000, False)
ADDON.setSetting(id='score_updates', value='false')