mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
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">
|
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">
|
||||||
|
|
|
@ -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
|
dbPath = xbmc.translatePath("special://userdata/Database/MyVideos" + dbVersion + ".db")
|
||||||
useMySQL = False
|
connection = sqlite3.connect(dbPath)
|
||||||
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)
|
|
||||||
|
|
||||||
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()
|
||||||
|
|
Loading…
Reference in a new issue