Allow the buffer warnings to be completely disabled by setting buffer threshold to 0.

Fix bug with buffer warnings where notification would trigger continuously after first trigger.
Fix bug where custom avatar URL would get reset on every user refresh.
This commit is contained in:
Tim 2015-08-15 21:30:31 +02:00
commit ad79d860db
7 changed files with 54 additions and 25 deletions

View file

@ -37,6 +37,15 @@ def refresh_users():
"is_restricted": item['is_restricted']
}
# Check if we've set a custom avatar if so don't overwrite it.
avatar_urls = monitor_db.select('SELECT thumb, custom_avatar_url '
'FROM users WHERE user_id = ?',
[item['user_id']])
if not avatar_urls[0]['custom_avatar_url'] or \
avatar_urls[0]['custom_avatar_url'] == avatar_urls[0]['thumb']:
new_value_dict['custom_avatar_url'] = item['thumb']
monitor_db.upsert('users', new_value_dict, control_value_dict)
logger.info("Users list refreshed.")