forked from vially/googlemusic-xbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.py
47 lines (38 loc) · 1.21 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
import sys, xbmc, xbmcgui, xbmcplugin, xbmcaddon, xbmcvfs
# plugin constants
version = "0.2.1"
plugin = "GoogleMusic-" + version
# xbmc hooks
settings = xbmcaddon.Addon(id='plugin.audio.googlemusic')
language = settings.getLocalizedString
dbg = settings.getSetting( "debug" ) == "true"
dbglevel = 3
# plugin variables
storage = ""
common = ""
if (__name__ == "__main__" ):
if dbg:
print plugin + " ARGV: " + repr(sys.argv)
else:
print plugin
import CommonFunctions
common = CommonFunctions
common.plugin = plugin
import GoogleMusicStorage
storage = GoogleMusicStorage.GoogleMusicStorage()
if (not settings.getSetting("firstrun")):
storage.initializeDatabase()
settings.setSetting("firstrun", "1")
import GoogleMusicNavigation
navigation = GoogleMusicNavigation.GoogleMusicNavigation()
if (not sys.argv[2]):
navigation.listMenu()
else:
params = common.getParameters(sys.argv[2])
get = params.get
if (get("action")):
navigation.executeAction(params)
elif (get("path")):
navigation.listMenu(params)
else:
print plugin + " ARGV Nothing done.. verify params " + repr(params)