From 64bd1b3fedf32c7c15c704107de08d0948445418 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 27 Mar 2015 12:20:40 +0100 Subject: [PATCH] removed the experimental mysql stuff --- addon.xml | 1 - resources/lib/Utils.py | 41 +++-------------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/addon.xml b/addon.xml index 1f52ed77..560c8845 100644 --- a/addon.xml +++ b/addon.xml @@ -5,7 +5,6 @@ provider-name="Emby.media"> - diff --git a/resources/lib/Utils.py b/resources/lib/Utils.py index 5b1a5bec..6fd1367d 100644 --- a/resources/lib/Utils.py +++ b/resources/lib/Utils.py @@ -12,6 +12,7 @@ import cProfile import pstats import time import inspect +import sqlite3 from xml.etree.ElementTree import Element, SubElement, Comment, tostring from xml.etree import ElementTree from xml.dom import minidom @@ -116,43 +117,8 @@ def KodiSQL(): #helix dbVersion = "90" - #find out if we should use MySQL - useMySQL = False - settingsFile = xbmc.translatePath( "special://profile/advancedsettings.xml" ) - if xbmcvfs.exists(settingsFile): - tree = ET.ElementTree(file=settingsFile) - root = tree.getroot() - video = root.find("videolibrary") - if video != None: - mysql = video.find("type") - if mysql != None: - useMySQL = True - db_port = video.find("port").text - db_host = video.find("host").text - db_user = video.find("user").text - db_pass = video.find("pass").text - if video.find("name") != None: - db_name = video.find("name").text - else: - db_name = "MyVideos" - - SubElement(video, "importwatchedstate").text = "true" - if video.find("importresumepoint") == None: - writeNeeded = True - SubElement(video, "importresumepoint").text = "true" - - - if useMySQL: - import local.mysql.connector as database - connection = database.connect(dbPath) - connection = database.connect(db = db_name, user = db_user, passwd = db_pass, host = db_host, port = db_port) - connection.set_charset('utf8') - connection.set_unicode(True) - - else: - import sqlite3 as database - dbPath = xbmc.translatePath("special://userdata/Database/MyVideos" + dbVersion + ".db") - connection = database.connect(dbPath) + dbPath = xbmc.translatePath("special://userdata/Database/MyVideos" + dbVersion + ".db") + connection = sqlite3.connect(dbPath) return connection @@ -162,7 +128,6 @@ def addKodiSource(name, path, type): #return boolean wether a manual reboot is required. #todo: Do feature request with Kodi team to get support for adding a source by the json API - error = False try: connection = KodiSQL()