Fix code indentation and move keys to addon home.
This commit is contained in:
parent
984fb7e7b9
commit
2afdf031e9
|
@ -15,6 +15,7 @@ base_url = sys.argv[0]
|
|||
addon_handle = int(sys.argv[1])
|
||||
args = urlparse.parse_qs(sys.argv[2][1:])
|
||||
addon = xbmcaddon.Addon()
|
||||
addon_base_path = xbmc.translatePath(addon.getAddonInfo('profile')).decode('utf-8')
|
||||
xbmcplugin.setContent(addon_handle, "files")
|
||||
|
||||
def build_url(query):
|
||||
|
@ -27,7 +28,7 @@ def index():
|
|||
if address == "0.0.0.0":
|
||||
address = gs.discover_server()
|
||||
|
||||
if not gs.connect_server(address):
|
||||
if not gs.connect_server(address, os.path.join(addon_base_path, "keys")):
|
||||
dialog = xbmcgui.Dialog()
|
||||
dialog.ok("Error", "Failed connect to server (%s)" % (address))
|
||||
return
|
||||
|
@ -47,12 +48,12 @@ def index():
|
|||
return
|
||||
|
||||
for appId, name in gs.applist():
|
||||
base_path = xbmc.translatePath(addon.getAddonInfo('profile')).decode('utf-8') + "/images"
|
||||
base_path = os.path.join(addon_base_path, "images")
|
||||
|
||||
if not os.path.exists(base_path):
|
||||
os.makedirs(base_path)
|
||||
|
||||
poster_path = base_path + "/" + str(appId) + ".png"
|
||||
poster_path = os.path.join(base_path, str(appId) + ".png")
|
||||
|
||||
if not os.path.isfile(poster_path):
|
||||
gs.poster(appId, base_path)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="script.moonlight" name="Moonlight" version="1.0.2" provider-name="dead">
|
||||
<addon id="script.moonlight" name="Moonlight" version="1.0.3" provider-name="dead">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.14.0"/>
|
||||
</requires>
|
||||
|
|
|
@ -68,6 +68,8 @@ do
|
|||
MOONLIGHT_ARG="$MOONLIGHT_ARG -app \"${MOONLIGHT_APP}\""
|
||||
fi
|
||||
|
||||
MOONLIGHT_ARG="$MOONLIGHT_ARG -keydir \"${ADDON_HOME}/keys\""
|
||||
|
||||
if [ "$MOON_SERVER_IP" != "0.0.0.0" ]; then
|
||||
MOONLIGHT_ARG="$MOONLIGHT_ARG $MOON_SERVER_IP"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue