removed the experimental mysql stuff

This commit is contained in:
Marcel van der Veldt 2015-03-27 12:20:40 +01:00
parent f306ceb67e
commit 64bd1b3fed
2 changed files with 3 additions and 39 deletions

View file

@ -5,7 +5,6 @@
provider-name="Emby.media"> provider-name="Emby.media">
<requires> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.myconnpy" version="0.3.2"/>
</requires> </requires>
<extension point="xbmc.python.pluginsource" <extension point="xbmc.python.pluginsource"
library="default.py"> library="default.py">

View file

@ -12,6 +12,7 @@ import cProfile
import pstats import pstats
import time import time
import inspect import inspect
import sqlite3
from xml.etree.ElementTree import Element, SubElement, Comment, tostring from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.etree import ElementTree from xml.etree import ElementTree
from xml.dom import minidom from xml.dom import minidom
@ -116,43 +117,8 @@ def KodiSQL():
#helix #helix
dbVersion = "90" 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") dbPath = xbmc.translatePath("special://userdata/Database/MyVideos" + dbVersion + ".db")
connection = database.connect(dbPath) connection = sqlite3.connect(dbPath)
return connection return connection
@ -162,7 +128,6 @@ def addKodiSource(name, path, type):
#return boolean wether a manual reboot is required. #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 #todo: Do feature request with Kodi team to get support for adding a source by the json API
error = False error = False
try: try:
connection = KodiSQL() connection = KodiSQL()