예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
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
예제 #4
0
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
예제 #5
0
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
예제 #6
0
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
예제 #7
0
	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)
예제 #8
0
	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)