def progress(self, fullpath, isComplete=True, startTime=0): # At the moment the only time progress is called is to mark as complete audiobookDB = AudioBooksDB() audiobookDB.setPosition(fullpath, startTime, isComplete) del audiobookDB xbmc.executebuiltin("Container.Refresh")
def clear(self, fullpath): log("AudioBooksPlugin: Clearing history for %s" % fullpath) # Remove the item from the database, it will then be rescanned audiobookDB = AudioBooksDB() audiobookDB.deleteAudioBook(fullpath) del audiobookDB xbmc.executebuiltin("Container.Refresh")
ADDON = xbmcaddon.Addon(id='script.audiobooks') ######################### # Main ######################### if __name__ == '__main__': log("AudioBookService: Checking audiobook database version (version %s)" % ADDON.getAddonInfo('version')) configPath = xbmc.translatePath(ADDON.getAddonInfo('profile')) databasefile = os_path_join(configPath, "audiobooks_database.db") log("AudioBookService: Checking database file = %s" % databasefile) # If the database file exists, check if it needs updating if xbmcvfs.exists(databasefile): audiobookDB = AudioBooksDB() audiobookDB.createDatabase() del audiobookDB if Settings.isFFmpegAutoDetect(): log("AudioBookService: Performing refresh check on FFmpeg") # Turn off the search at startup as we do not want to do this every time Settings.clearFFmpegAutoDetect() # Clear the existing settings Settings.setFFmpegLibraryLocation("") Settings.setFFmpegExecLocation("") log("AudioBookService: Platform Type: %s" % sys.platform.lower()) # Perform a check to see if we can automatically detect where the libraries