def categorySearch(self):
d = xbmcgui.Dialog()
f = xbmcvfs.File('special://profile/addon_data/script.tvguide.fullscreen/category_count.ini',"rb")
category_count = [x.split("=",1) for x in f.read().splitlines()]
f.close()
categories = []
for (c,v) in category_count:
if not self.category or self.category == "All Channels":
s = "%s (%s)" % (c,v)
else:
s = c
categories.append(s)
which = d.select("Program Category Search",categories)
if which == -1:
return
category = category_count[which][0]
programList = self.database.programCategorySearch(category)
title = "%s" % category
d = ProgramListDialog(title, programList, ADDON.getSetting('listing.sort.time') == 'true')
d.doModal()
index = d.index
action = d.action
if action == ACTION_RIGHT:
self.showNext()
elif action == ACTION_LEFT:
self.showListing(programList[index].channel)
elif action == KEY_CONTEXT_MENU:
if index > -1:
self._showContextMenu(programList[index])
else:
if index > -1:
program = programList[index]
now = datetime.datetime.now()
start = program.startDate
end = program.endDate
ask = ADDON.getSetting('catchup.dialog')
if (ask == "3") or (ask=="2" and end < now) or (ask=="1" and start < now):
self.play_catchup(program)
else:
self.playOrChoose(program)
评论列表
文章目录