예제 #1
0
	def __init__(self, steps):
		self.enable = setting('hide_progress') == 'false' # todo temp until gotham
		self.steps = steps
		self.current = 0
		if steps > 0:
			if self.enable: # todo temp until gotham
				if utilxbmc.version() == 13: # todo temp until gotham
					self.bar = xbmcgui.DialogProgressBG()
				else: # todo temp until gotham
					self.bar = xbmcgui.DialogProgress() # todo temp until gotham
				if not utilxbmc.version() == 13: # todo temp until gotham
					self.bar = xbmcgui.DialogProgress() # todo temp until gotham
				self.bar.create(info('name'))
				self.bar.update(0, info('name'))
예제 #2
0
	def update_library(self):
		xbmc.executebuiltin('CleanLibrary(video)')
		while not xbmc.getCondVisibility('Library.IsScanningVideo'):
			pass
		while xbmc.getCondVisibility('Library.IsScanningVideo'):
			xbmc.sleep(20)
		if self.enable: # todo temp until gotham
			self.bar.close() # todo temp until gotham
			self.bar = None # todo temp until gotham
		xbmc.executebuiltin('UpdateLibrary(video)')
		while not xbmc.getCondVisibility('Library.IsScanningVideo'):
			pass
		while xbmc.getCondVisibility('Library.IsScanningVideo'):
			xbmc.sleep(20)
		percent = (self.current-1) * 100 / self.steps
		if self.enable: # todo temp until gotham
			if utilxbmc.version() == 13: # todo temp until gotham
				self.bar = xbmcgui.DialogProgressBG()
			else: # todo temp until gotham
				self.bar = xbmcgui.DialogProgress() # todo temp until gotham
			self.bar.create(info('name')) # todo temp until gotham
			self.bar.update(percent, info('name'),  lang(30531) % (self.module_title, lang(30513)))