mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Set up for central addon settings
Please start using it for new methods. I will take care of changing older ones.
This commit is contained in:
parent
05be6eaa07
commit
40b381de94
1 changed files with 10 additions and 7 deletions
|
@ -21,8 +21,8 @@ from API import API
|
||||||
from PlayUtils import PlayUtils
|
from PlayUtils import PlayUtils
|
||||||
from DownloadUtils import DownloadUtils
|
from DownloadUtils import DownloadUtils
|
||||||
downloadUtils = DownloadUtils()
|
downloadUtils = DownloadUtils()
|
||||||
addonSettings = xbmcaddon.Addon()
|
addon = xbmcaddon.Addon()
|
||||||
language = addonSettings.getLocalizedString
|
language = addon.getLocalizedString
|
||||||
|
|
||||||
|
|
||||||
def logMsg(title, msg, level = 1):
|
def logMsg(title, msg, level = 1):
|
||||||
|
@ -184,10 +184,13 @@ def createSources():
|
||||||
'</sources>'
|
'</sources>'
|
||||||
)
|
)
|
||||||
|
|
||||||
def CleanName(filename):
|
def settings(setting, value=""):
|
||||||
validFilenameChars = "-_.() %s%s" % (string.ascii_letters, string.digits)
|
# Get or add addon setting
|
||||||
cleanedFilename = unicodedata.normalize('NFKD', filename).encode('ASCII', 'ignore')
|
addon = xbmcaddon.Addon()
|
||||||
return ''.join(c for c in cleanedFilename if c in validFilenameChars)
|
if value:
|
||||||
|
addon.setSetting(setting, value)
|
||||||
|
else:
|
||||||
|
return addon.getSetting(setting)
|
||||||
|
|
||||||
def normalize_string(text):
|
def normalize_string(text):
|
||||||
# For theme media, do not modify unless
|
# For theme media, do not modify unless
|
||||||
|
@ -280,7 +283,7 @@ def reset():
|
||||||
connection.commit()
|
connection.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
if addonSettings.getSetting("enableMusicSync") == "true":
|
if addon.getSetting("enableMusicSync") == "true":
|
||||||
# delete video db table data
|
# delete video db table data
|
||||||
print "Doing Music DB Reset"
|
print "Doing Music DB Reset"
|
||||||
connection = KodiSQL("music")
|
connection = KodiSQL("music")
|
||||||
|
|
Loading…
Reference in a new issue