Update photos library display

This commit is contained in:
angelblue05 2017-11-25 17:35:07 -06:00
parent 354a6669ac
commit 634090e93c
2 changed files with 16 additions and 7 deletions

View file

@ -76,9 +76,9 @@ class Main(object):
else: else:
entrypoint.doMainListing() entrypoint.doMainListing()
try: """try:
xbmcplugin.endOfDirectory(int(sys.argv[1])) xbmcplugin.endOfDirectory(int(sys.argv[1]))
except Exception: pass except Exception: pass"""
@classmethod @classmethod
def _modes(cls, mode, params): def _modes(cls, mode, params):

View file

@ -619,8 +619,8 @@ def BrowseContent(viewname, browse_type="", folderid=""):
#set the correct params for the content type #set the correct params for the content type
#only proceed if we have a folderid #only proceed if we have a folderid
if folderid: if folderid:
if browse_type.lower() == "homevideos": if browse_type == "homevideos":
xbmcplugin.setContent(int(sys.argv[1]), 'files') #xbmcplugin.setContent(int(sys.argv[1]), 'files')
itemtype = "Video,Folder,PhotoAlbum,Photo" itemtype = "Video,Folder,PhotoAlbum,Photo"
else: else:
itemtype = "" itemtype = ""
@ -637,7 +637,7 @@ def BrowseContent(viewname, browse_type="", folderid=""):
elif filter_type == "recommended": elif filter_type == "recommended":
listing = emby.getFilteredSection(folderid, itemtype=itemtype.split(",")[0], sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite") listing = emby.getFilteredSection(folderid, itemtype=itemtype.split(",")[0], sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite")
elif folderid == "favepisodes": elif folderid == "favepisodes":
xbmcplugin.setContent(int(sys.argv[1]), 'episodes') #xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
listing = emby.getFilteredSection(None, itemtype="Episode", sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite") listing = emby.getFilteredSection(None, itemtype="Episode", sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite")
elif filter_type == "sets": elif filter_type == "sets":
listing = emby.getFilteredSection(folderid, itemtype=itemtype.split(",")[1], sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite") listing = emby.getFilteredSection(folderid, itemtype=itemtype.split(",")[1], sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite")
@ -659,8 +659,8 @@ def BrowseContent(viewname, browse_type="", folderid=""):
} }
path = plugin_path("plugin://plugin.video.emby/", params) path = plugin_path("plugin://plugin.video.emby/", params)
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=path, listitem=li, isFolder=True) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=path, listitem=li, isFolder=True)
else: else: #playable item, set plugin path and mediastreams
#playable item, set plugin path and mediastreams xbmcplugin.setContent(int(sys.argv[1]), 'episodes' if folderid else 'files')
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=li.getProperty("path"), listitem=li) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=li.getProperty("path"), listitem=li)
@ -710,6 +710,15 @@ def createListItemFromEmbyItem(item,art=artwork.Artwork(),doUtils=downloadutils.
li.setThumbnailImage(img_path) li.setThumbnailImage(img_path)
li.setProperty("plot",API.get_overview()) li.setProperty("plot",API.get_overview())
li.setIconImage('DefaultPicture.png') li.setIconImage('DefaultPicture.png')
elif item['Type'] == "PhotoAlbum":
img_path = allart.get('Primary')
li.setProperty("path", img_path)
li.setThumbnailImage(img_path)
li.setIconImage('DefaultPicture.png')
backdrop = allart.get('Backdrop')
if backdrop:
li.setArt({ 'fanart': backdrop[0] })
else: else:
#normal video items #normal video items
li.setProperty('IsPlayable', 'true') li.setProperty('IsPlayable', 'true')