diff --git a/plexpy/webauth.py b/plexpy/webauth.py index 50ce2d2c..d105a8c2 100644 --- a/plexpy/webauth.py +++ b/plexpy/webauth.py @@ -99,7 +99,7 @@ def plex_user_login(token=None, headers=None): try: logger.debug("Tautulli WebAuth :: Registering token for user '%s' in the database." % user_details['username']) - result = monitor_db.action('UPDATE users SET server_token = ? WHERE user_id = ?', + result = monitor_db.action("UPDATE users SET server_token = ? WHERE user_id = ?", [server_token, user_details['user_id']]) if result: @@ -246,12 +246,12 @@ def all_of(*conditions): def check_rate_limit(ip_address): monitor_db = MonitorDatabase() - result = monitor_db.select('SELECT timestamp, success FROM user_login ' - 'WHERE ip_address = ? ' - 'AND timestamp >= ( ' - 'SELECT CASE WHEN MAX(timestamp) IS NULL THEN 0 ELSE MAX(timestamp) END ' - 'FROM user_login WHERE ip_address = ? AND success = 1) ' - 'ORDER BY timestamp DESC', + result = monitor_db.select("SELECT timestamp, success FROM user_login " + "WHERE ip_address = ? " + "AND timestamp >= ( " + "SELECT CASE WHEN MAX(timestamp) IS NULL THEN 0 ELSE MAX(timestamp) END " + "FROM user_login WHERE ip_address = ? AND success = 1) " + "ORDER BY timestamp DESC", [ip_address, ip_address]) try: