removed the experimental mysql stuff
This commit is contained in:
parent
f306ceb67e
commit
64bd1b3fed
2 changed files with 3 additions and 39 deletions
|
@ -5,7 +5,6 @@
|
|||
provider-name="Emby.media">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.1.0"/>
|
||||
<import addon="script.module.myconnpy" version="0.3.2"/>
|
||||
</requires>
|
||||
<extension point="xbmc.python.pluginsource"
|
||||
library="default.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)
|
||||
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()
|
||||
|
|
Loading…
Reference in a new issue