forked from jonian/game.retroarch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addon.py
37 lines (27 loc) · 1.44 KB
/
addon.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
import os
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
xbmc.executebuiltin('ActivateWindow(busydialog)')
os.system("echo 'RetroArch [ADDON] ::' $(date) > /storage/.kodi/temp/retroarch.log")
os.system("echo '======================' >> /storage/.kodi/temp/retroarch.log")
os.system("mkdir -p /storage/.kodi/userdata/addon_data/game.retroarch")
os.system("if [ -L /storage/.config/retroarch ] ; then rm /storage/.config/retroarch ; fi")
os.system("ln -s /storage/.kodi/userdata/addon_data/game.retroarch /storage/.config/retroarch")
os.system("chmod a+x /storage/.kodi/addons/game.retroarch/addon.sh")
os.system("chmod a+x /storage/.kodi/addons/game.retroarch/addon.start")
os.system("chmod a+x /storage/.kodi/addons/game.retroarch/game.retroarch")
askConfirmation = xbmcplugin.getSetting(int(sys.argv[1]), 'ask')
runConfirmation = True
if askConfirmation == "true":
runConfirmation = xbmcgui.Dialog().yesno("RetroArch", "Exit Kodi and run RetroArch?")
if runConfirmation:
xbmc.executebuiltin('ShowPicture("/storage/.kodi/addons/game.retroarch/resources/fanart.jpg")')
xbmc.executebuiltin('ActivateWindow(busydialog)')
os.system("echo 'RetroArch [ADDON] :: Kodi is ready.' >> /storage/.kodi/temp/retroarch.log")
os.system("sh /storage/.kodi/addons/game.retroarch/addon.sh")
else:
os.system("echo 'RetroArch [ADDON] :: Abort launch.' >> /storage/.kodi/temp/retroarch.log")