Fix SQLite Double-Quoted Strings (#2057)

* Fix __init__.py

* Fix activity_pinger.py

* Fix activity_processor.py

* Fix database.py

* Fix datafactory.py

* Fix exporter.py

* Fix graphs.py

* Fix libraries.py

* Fix mobile_app.py

* Fix newsletter_handler.py

* Fix newsletters.py

* Fix notification_handler.py

* Fix notifiers.py

* Fix plexivity_import.py

* Fix plexwatch_import.py

* Fix users.py

* Fix webauth.py
This commit is contained in:
JonnyWong16 2023-05-15 11:03:26 -07:00 committed by GitHub
parent 3a1d6322ae
commit f39b9f9087
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 2220 additions and 2217 deletions

View file

@ -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: