forked from primaeval/plugin.video.iptv.recorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontext.py
39 lines (30 loc) · 1.4 KB
/
context.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
import urllib
import xbmc
import xbmcgui
def log(x):
xbmc.log(repr(x), xbmc.LOGERROR)
channel = xbmc.getInfoLabel('ListItem.Label')
channel = channel.decode("utf8")
channel = channel.encode("utf8")
channel = urllib.quote_plus(channel)
try:
d = xbmcgui.Dialog()
select = d.select("IPTV Recorder", ["Add Timed Recording",
"Add Daily Timed Recording",
"Add Weekly Timed Recording",
"Record and Play"])
if select != -1:
if select == 0:
cmd = "ActivateWindow(videos,plugin://plugin.video.iptv.recorder/record_one_time/%s,return)" % (channel)
result = xbmc.executebuiltin(cmd)
elif select == 1:
cmd = "ActivateWindow(videos,plugin://plugin.video.iptv.recorder/record_daily_time/%s,return)" % (channel)
result = xbmc.executebuiltin(cmd)
elif select == 2:
cmd = "ActivateWindow(videos,plugin://plugin.video.iptv.recorder/record_weekly_time/%s,return)" % (channel)
result = xbmc.executebuiltin(cmd)
elif select == 3:
cmd = "ActivateWindow(videos,plugin://plugin.video.iptv.recorder/record_and_play/%s,return)" % (channel)
result = xbmc.executebuiltin(cmd)
except:
xbmcgui.Dialog().notification("IPTV Recorder", "channel not found", xbmcgui.NOTIFICATION_WARNING)