added support for channels

This commit is contained in:
Marcel van der Veldt 2015-05-05 04:53:21 +02:00
parent 57156cfb1c
commit c374b166bb
3 changed files with 29 additions and 13 deletions

View file

@ -163,6 +163,8 @@ class PlayUtils():
return '2147483' # max bit rate supported by server (max signed 32bit integer)
def fileExists(self, result):
if not result.has_key("Path"):
return False
path=result.get("Path").encode('utf-8')
if os.path.exists(path) == True:
return True

View file

@ -1040,8 +1040,19 @@ class WriteKodiDB():
#we need to copy over the default items
import shutil
shutil.copytree(xbmc.translatePath("special://xbmc/system/library/video"), xbmc.translatePath("special://userdata/library/video"))
libraryPath = xbmc.translatePath("special://userdata/library/video/emby/")
#create tag node for emby channels
nodefile = os.path.join(xbmc.translatePath("special://userdata/library/video"), "emby_channels.xml")
if not xbmcvfs.exists(nodefile):
root = Element("node", {"order":"20", "type":"folder"})
SubElement(root, "label").text = "Emby - Channels"
SubElement(root, "path").text = "plugin://plugin.video.emby/?id=0&mode=channels"
SubElement(root, "icon").text = "DefaultMovies.png"
try:
ET.ElementTree(root).write(nodefile, xml_declaration=True)
except:
ET.ElementTree(root).write(nodefile)
if type == "movie":
type = "movies"
@ -1170,6 +1181,7 @@ class WriteKodiDB():
ET.ElementTree(root).write(nodefile, xml_declaration=True)
except:
ET.ElementTree(root).write(nodefile)
def updateBoxsetToKodiLibrary(self, boxsetmovie, boxset, connection, cursor):
strSet = boxset["Name"]