mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
advancedsettings.xml can get the watchedstates imported
This commit is contained in:
parent
1f078194bd
commit
a1a074b66f
1 changed files with 23 additions and 2 deletions
|
@ -118,8 +118,29 @@ def addKodiSource(name, path, type):
|
||||||
SubElement(source, "path").text = path
|
SubElement(source, "path").text = path
|
||||||
tree.write(sourcesFile)
|
tree.write(sourcesFile)
|
||||||
#return bool that reboot is needed and manual add of path to kodi
|
#return bool that reboot is needed and manual add of path to kodi
|
||||||
#return True
|
return KodiAdvancedSettingsCheck()
|
||||||
|
|
||||||
|
def KodiAdvancedSettingsCheck():
|
||||||
|
#setting that kodi should import watched state and resume points from the nfo files
|
||||||
|
settingsFile = xbmc.translatePath( "special://profile/advancedsettings.xml" )
|
||||||
|
# add an empty sources file to work with
|
||||||
|
if xbmcvfs.exists(settingsFile) == False:
|
||||||
|
sources = Element("advancedsettings")
|
||||||
|
video = SubElement(sources, "videolibrary")
|
||||||
|
ET.ElementTree(sources).write(settingsFile)
|
||||||
|
|
||||||
|
if xbmcvfs.exists(settingsFile):
|
||||||
|
tree = ET.ElementTree(file=settingsFile)
|
||||||
|
root = tree.getroot()
|
||||||
|
video = root.find("videolibrary")
|
||||||
|
if video == None:
|
||||||
|
video = SubElement(sources, "videolibrary")
|
||||||
|
# add the settings
|
||||||
|
SubElement(video, "importwatchedstate").text = "true"
|
||||||
|
SubElement(video, "importresumepoint").text = "true"
|
||||||
|
tree.write(settingsFile)
|
||||||
|
#return bool that reboot is needed and manual add of path to kodi
|
||||||
|
return True
|
||||||
|
|
||||||
def checkAuthentication():
|
def checkAuthentication():
|
||||||
#check authentication
|
#check authentication
|
||||||
|
|
Loading…
Reference in a new issue