def GetAllShows(self): shows = common.fetch_showlist(0) self.ExportShowList(shows, 750) self.Notification(addon.getLocalizedString(39036), addon.getLocalizedString(39037) % addon.getLocalizedString(39002), image=ustvpaths.ALLICON)
def GetFavoriteEpisodes(self): shows = common.fetch_showlist(1) self.ExportShowList(shows, 750) self.Notification(addon.getLocalizedString(39036), addon.getLocalizedString(39037) % addon.getLocalizedString(39000), image=ustvpaths.FAVICON)
def import_fav(): print 'fav' dialog = xbmcgui.Dialog() print 'd' try: r = dialog.browse(3, 'Folder', 'files') print r path = os.path.join(r, 'favorites.txt') shows = common.fetch_showlist(1) sd = {} for show in shows: sd[show[0]] = show import json print r json_data = open(path).read() #print json_data jd = json.loads(json_data) for title in jd: show = jd[title] series_title = show[0] mode = show[1] submode = show[2] series_title = urllib.unquote_plus(series_title) command = 'update shows set favor = 1 where series_title = ? and mode = ? and submode = ?;' values = (series_title, mode, submode) print values database.execute_command(command, values, commit=True) except Exception, e: print e
def import_fav(): print 'fav' dialog = xbmcgui.Dialog() print 'd' try: r = dialog.browse(3, 'Folder', 'files') print r path = os.path.join(r, 'favorites.txt') shows = common.fetch_showlist(1) sd = {} for show in shows: sd[show[0]] = show import json print r json_data=open(path).read() #print json_data jd = json.loads(json_data) for title in jd: show = jd[title] series_title = show[0] mode = show[1] submode = show[2] series_title = urllib.unquote_plus(series_title) command = 'update shows set favor = 1 where series_title = ? and mode = ? and submode = ?;' values = (series_title, mode, submode) print values database.execute_command(command, values, commit = True) except Exception,e: print e
def export_fav(): print 'fav' dialog = xbmcgui.Dialog() print 'd' try: r = dialog.browse(3, 'Folder', 'files') print r path = os.path.join(r, 'favorites.txt') shows = common.fetch_showlist(1) sd = {} for show in shows: sd[show[0]] = show import json with open(path, 'w') as outfile: json.dump(sd, outfile) except Exception, e: print e
def export_fav(): print 'fav' dialog = xbmcgui.Dialog() print 'd' try: r = dialog.browse(3, 'Folder', 'files') print r path = os.path.join(r, 'favorites.txt') shows = common.fetch_showlist(1) sd = {} for show in shows: sd[show[0]] = show import json with open(path, 'w') as outfile: json.dump(sd, outfile) except Exception,e: print e
def GetFavoriteEpisodes(self): shows = common.fetch_showlist(1) self.ExportShowList(shows, 750) self.Notification(addon.getLocalizedString(39036), addon.getLocalizedString(39037) % addon.getLocalizedString(39000), image = ustvpaths.FAVICON)
def GetAllShows(self): shows = common.fetch_showlist(0) self.ExportShowList(shows, 750) self.Notification(addon.getLocalizedString(39036), addon.getLocalizedString(39037) % addon.getLocalizedString(39002), image = ustvpaths.ALLICON)