mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
support systems using python version less than 2.7 (such as Mac)
This commit is contained in:
parent
7c7b4b375f
commit
78bc187c1f
1 changed files with 10 additions and 4 deletions
|
@ -12,8 +12,6 @@ import time
|
||||||
from calendar import timegm
|
from calendar import timegm
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
@ -24,6 +22,7 @@ from API import API
|
||||||
import Utils as utils
|
import Utils as utils
|
||||||
from ReadEmbyDB import ReadEmbyDB
|
from ReadEmbyDB import ReadEmbyDB
|
||||||
|
|
||||||
|
|
||||||
addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
|
addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
|
||||||
addondir = xbmc.translatePath(addon.getAddonInfo('profile'))
|
addondir = xbmc.translatePath(addon.getAddonInfo('profile'))
|
||||||
dataPath = os.path.join(addondir,"library")
|
dataPath = os.path.join(addondir,"library")
|
||||||
|
@ -238,7 +237,14 @@ class CreateFiles():
|
||||||
SubElement(actor_elem, "type").text = utils.convertEncoding(actor.get("Role"))
|
SubElement(actor_elem, "type").text = utils.convertEncoding(actor.get("Role"))
|
||||||
SubElement(actor_elem, "thumb").text = downloadUtils.imageUrl(actor.get("Id"), "Primary", 0, 400, 400)
|
SubElement(actor_elem, "thumb").text = downloadUtils.imageUrl(actor.get("Id"), "Primary", 0, 400, 400)
|
||||||
|
|
||||||
|
# Some devices such as Mac are using an older version of python
|
||||||
|
try:
|
||||||
|
# 2.7 and greater
|
||||||
ET.ElementTree(root).write(nfoFile, xml_declaration=True)
|
ET.ElementTree(root).write(nfoFile, xml_declaration=True)
|
||||||
|
except:
|
||||||
|
# <2.7
|
||||||
|
ET.ElementTree(root).write(nfoFile)
|
||||||
|
|
||||||
|
|
||||||
return changes
|
return changes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue