mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +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 DownloadUtils import DownloadUtils
|
||||
downloadUtils = DownloadUtils()
|
||||
addonSettings = xbmcaddon.Addon()
|
||||
language = addonSettings.getLocalizedString
|
||||
addon = xbmcaddon.Addon()
|
||||
language = addon.getLocalizedString
|
||||
|
||||
|
||||
def logMsg(title, msg, level = 1):
|
||||
|
@ -184,10 +184,13 @@ def createSources():
|
|||
'</sources>'
|
||||
)
|
||||
|
||||
def CleanName(filename):
|
||||
validFilenameChars = "-_.() %s%s" % (string.ascii_letters, string.digits)
|
||||
cleanedFilename = unicodedata.normalize('NFKD', filename).encode('ASCII', 'ignore')
|
||||
return ''.join(c for c in cleanedFilename if c in validFilenameChars)
|
||||
def settings(setting, value=""):
|
||||
# Get or add addon setting
|
||||
addon = xbmcaddon.Addon()
|
||||
if value:
|
||||
addon.setSetting(setting, value)
|
||||
else:
|
||||
return addon.getSetting(setting)
|
||||
|
||||
def normalize_string(text):
|
||||
# For theme media, do not modify unless
|
||||
|
@ -280,7 +283,7 @@ def reset():
|
|||
connection.commit()
|
||||
cursor.close()
|
||||
|
||||
if addonSettings.getSetting("enableMusicSync") == "true":
|
||||
if addon.getSetting("enableMusicSync") == "true":
|
||||
# delete video db table data
|
||||
print "Doing Music DB Reset"
|
||||
connection = KodiSQL("music")
|
||||
|
|
Loading…
Reference in a new issue