'Internal wrapper for the update library function to branch the logic for JSON-RPC or legacy HTTP API
Checks the KODI API version to branch the logic to call either the legacy HTTP API or the newer JSON-RPC over HTTP methods.
Args:
host: KODI webserver host:port
showName: Name of a TV show to specifically target the library update for
Returns:
Returns True or False, if the update was successful'

def _send_update_library(self, host, showName=None):

    sickrage.srCore.srLogger.debug(((u"Sending    request    to    update    library    for    KODI    host:    '" + host) + u"'"))
    kodiapi = self._get_kodi_version(host, sickrage.srCore.srConfig.KODI_USERNAME, sickrage.srCore.srConfig.KODI_PASSWORD)
    if kodiapi:
        if (kodiapi <= 4):
            if ((not self._update_library(host, showName)) and sickrage.srCore.srConfig.KODI_UPDATE_FULL):
                sickrage.srCore.srLogger.debug(u'Single    show    update    failed,    falling    back    to    full    update')
                return self._update_library(host)
            else:
                return True
        elif ((not self._update_library_json(host, showName)) and sickrage.srCore.srConfig.KODI_UPDATE_FULL):
            sickrage.srCore.srLogger.debug(u'Single    show    update    failed,    falling    back    to    full    update')
            return self._update_library_json(host)
        else:
            return True
    elif sickrage.srCore.srConfig.KODI_ALWAYS_ON:
        sickrage.srCore.srLogger.warning(((u"Failed    to    detect    KODI    version    for    '" + host) + u"',    check    configuration    and    try    again."))
    return False
