def METHOD_NAME(date_last_start=None):
    try:
        if G.ADDON.getSettingBool('use_mysql'):
            client_uuid = G.LOCAL_DB.get_value('client_uuid')
            uuid = G.SHARED_DB.get_value('auto_update_device_uuid')
            if client_uuid != uuid:
                LOG.debug('The auto update has been disabled because another device '
                          'has been set as the main update manager')
                return None
        last_run = date_last_start or G.SHARED_DB.get_value('library_auto_update_last_start',
                                                            datetime.utcfromtimestamp(0))
        if G.ADDON.getSettingInt('lib_auto_upd_mode') == 0:  # Update at Kodi startup
            time = '00:00'
            update_frequency = 0
        else:
            time = G.ADDON.getSetting('lib_auto_upd_start') or '00:00'
            update_frequency = G.ADDON.getSettingInt('lib_auto_upd_freq')
        last_run = last_run.replace(hour=int(time[0:2]), minute=int(time[3:5]))
        next_run = last_run + timedelta(days=[1, 2, 5, 7][update_frequency])
        if next_run >= datetime.now():
            LOG.info('Next library auto update is scheduled for {}', next_run)
        return next_run
    except Exception:  # pylint: disable=broad-except
        # If settings.xml was not created yet, as at first service run
        # G.ADDON.getSettingBool('use_mysql') will thrown a TypeError
        # If any other error appears, we don't want the service to crash,
        # let's return None in all case
        # import traceback
        # LOG.debug(traceback.format_exc())
        LOG.warn('Managed error at _compute_next_schedule')
        return None