-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault.py
37 lines (27 loc) · 1.2 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
# -*- coding: utf-8 -*-
import xbmc
import xbmcgui
import xbmcaddon
import os
from resources.lib.utils import *
mode = xbmcgui.Dialog().select(getString(30030),[getString(30031),getString(30032)])
#check if program should be run
if(mode != -1):
if(mode == 0):
#open the settings dialog
openSettings()
elif(mode == 1):
addonid = 'pvr.iptvsimple'
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "%s", "enabled": true }, "id": 1 }' %(addonid))
iptvsimple = xbmcaddon.Addon(id=addonid)
iptvsimple.setSetting("logoPathType", "0") #set to local path
logoPath = os.path.join(addon_dir(), "resources", "media")
iptvsimple.setSetting("logoPath", logoPath)
iptvsimple.setSetting("m3uPathType", "0") #set to local path
m3uPath = os.path.join(addon_dir(), "resources", "channel.m3u")
iptvsimple.setSetting("m3uPath", m3uPath)
if getSetting("epg") == "true":
iptvsimple.setSetting("epgPathType", "0") #set to local path
epgPath = os.path.join(data_dir(), "epg.xml")
iptvsimple.setSetting("epgPath", epgPath)
iptvsimple.openSettings()