More rename, more -python2

This commit is contained in:
2021-02-05 17:29:23 +01:00
parent b867dc9be2
commit 1df28243c3
40 changed files with 1424 additions and 1412 deletions

View File

@@ -13,24 +13,16 @@
# You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from future.builtins import str
from future.builtins import object
import os
import sqlite3
import shutil
import sqlite3
import threading
import time
import jellypy
if jellypy.PYTHON2:
import helpers
import logger
else:
from jellypy import helpers
from jellypy import logger
from jellypy import helpers
from jellypy import logger
FILENAME = "tautulli.db"
db_lock = threading.Lock()
@@ -455,8 +447,9 @@ class MonitorDatabase(object):
if self.connection.total_changes == changes_before:
trans_type = 'insert'
insert_query = (
"INSERT INTO " + table_name + " (" + ", ".join(list(value_dict.keys()) + list(key_dict.keys())) + ")" +
" VALUES (" + ", ".join(["?"] * len(list(value_dict.keys()) + list(key_dict.keys()))) + ")"
"INSERT INTO " + table_name + " (" + ", ".join(
list(value_dict.keys()) + list(key_dict.keys())) + ")" +
" VALUES (" + ", ".join(["?"] * len(list(value_dict.keys()) + list(key_dict.keys()))) + ")"
)
try:
self.action(insert_query, list(value_dict.values()) + list(key_dict.values()))
@@ -470,4 +463,4 @@ class MonitorDatabase(object):
# Get the last insert row id
result = self.select_single(query='SELECT last_insert_rowid() AS last_id')
if result:
return result.get('last_id', None)
return result.get('last_id', None)