This commit is contained in:
angelblue05 2016-11-05 17:36:52 -05:00
parent 5b6a53f58b
commit 48405f6215

View file

@ -5,6 +5,7 @@
import logging import logging
import shutil import shutil
import os import os
import unicodedata
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
import xbmc import xbmc
@ -25,13 +26,6 @@ KODI = int(xbmc.getInfoLabel('System.BuildVersion')[:2])
class Views(object): class Views(object):
total_nodes = 0
nodes = list()
playlists = list()
views = list()
sorted_views = list()
grouped_views = list()
media_types = { media_types = {
'movies': "Movie", 'movies': "Movie",
'tvshows': "Series", 'tvshows': "Series",
@ -45,6 +39,13 @@ class Views(object):
self.emby_cursor = emby_cursor self.emby_cursor = emby_cursor
self.kodi_cursor = kodi_cursor self.kodi_cursor = kodi_cursor
self.total_nodes = 0
self.nodes = list()
self.playlists = list()
self.views = list()
self.sorted_views = list()
self.grouped_views = list()
self.video_nodes = VideoNodes() self.video_nodes = VideoNodes()
self.playlist = Playlist() self.playlist = Playlist()
self.emby = embyserver.Read_EmbyServer() self.emby = embyserver.Read_EmbyServer()
@ -288,7 +289,7 @@ class Views(object):
# Create the video node # Create the video node
if view_name not in self.nodes and media_type not in ('musicvideos', 'music'): if view_name not in self.nodes and media_type not in ('musicvideos', 'music'):
index = self.sorted_views.index(view_name) index = self.sorted_views.index(view_name)
self.video_nodes.viewNode(index, view_name, media_type,view_type, view_id) self.video_nodes.viewNode(index, view_name, media_type, view_type, view_id)
if view_type == "mixed": # Change the value if view_type == "mixed": # Change the value
self.sorted_views[index] = "%ss" % view_name self.sorted_views[index] = "%ss" % view_name
@ -374,7 +375,7 @@ class Playlist(object):
'</smartplaylist>' '</smartplaylist>'
% (special_types.get(media_type, media_type), name, tag)) % (special_types.get(media_type, media_type), name, tag))
f.close() f.close()
log.info("successfully added playlist: %s" % tag) log.info("successfully added playlist: %s", tag)
@classmethod @classmethod
def _delete_playlist(cls, path): def _delete_playlist(cls, path):
@ -444,7 +445,6 @@ class VideoNodes(object):
else: else:
dirname = viewid dirname = viewid
nodepath = xbmc.translatePath( nodepath = xbmc.translatePath(
"special://profile/library/video/emby/%s/" % dirname).decode('utf-8') "special://profile/library/video/emby/%s/" % dirname).decode('utf-8')