def queue_remove(self, library, path=None): if settings.REMOVAL_ENABLED: if settings.PER_FILE_REMOVE and path and library == 'video': videolibrary.remove_video(path) else: self._cmd_queue.put("CleanLibrary(%s,%s)" % (library, settings.SHOW_PROGRESS_DIALOG))
def update_library(self, path=False): if debug.get(): log('remove_video setting set to %s' % (setting('remove_video'))) if path and setting('remove_video') == 'true': if debug.get(): log('removing video from video library %s' % (path)) videolibrary.remove_video(path) if debug.get(): log('update_library setting set to %s' % (setting('update_library'))) if setting('update_library') == 'true': if debug.get(): log('updating whole video library %s' % (path)) 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: self.bar.update(percent, info('name'), lang(30531) % (self.module_title, lang(30513))) self.current += 1 self.module_current += 1 log('Progress.update_library: self.current=%s, self.module_current=%s' % (self.current, self.module_current))
def update_library(self, path=False): if path and setting('remove_video') == 'true': videolibrary.remove_video(path) if setting('update_library') == 'true': 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: if utilxbmc.version() >= 13: self.bar = xbmcgui.DialogProgressBG() else: self.bar = xbmcgui.DialogProgress() self.bar.create(info('name')) self.bar.update(percent, info('name'), lang(30531) % (self.module_title, lang(30513)))