示例#1
0

#########################
# 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
        # are, on windows we should already have them