add favourite episodes node

This commit is contained in:
marcelveldt 2016-09-23 20:46:04 +02:00
parent bcd8f576df
commit c3eb8a5598
3 changed files with 9 additions and 0 deletions

View file

@ -605,6 +605,9 @@ def BrowseContent(viewname, browse_type="", folderid=""):
listing = emby.getFilteredSection(folderid, itemtype=itemtype.split(",")[0], sortby="Random", recursive=True, limit=150, sortorder="Descending")
elif filter_type == "recommended":
listing = emby.getFilteredSection(folderid, itemtype=itemtype.split(",")[0], sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite")
elif folderid == "favepisodes":
xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
listing = emby.getFilteredSection(None, itemtype="Episode", sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite")
elif filter_type == "sets":
listing = emby.getFilteredSection(folderid, itemtype=itemtype.split(",")[1], sortby="SortName", recursive=True, limit=25, sortorder="Ascending", filter_type="IsFavorite")
else:

View file

@ -582,6 +582,8 @@ class LibrarySync(threading.Thread):
totalnodes += 1
self.vnodes.singleNode(totalnodes, "Favorite tvshows", "tvshows", "favourites")
totalnodes += 1
self.vnodes.singleNode(totalnodes, "Favorite episodes", "episodes", "favourites")
totalnodes += 1
self.vnodes.singleNode(totalnodes, "channels", "movies", "channels")
totalnodes += 1
# Save total

View file

@ -333,6 +333,7 @@ class VideoNodes(object):
'Favorite movies': 30180,
'Favorite tvshows': 30181,
'Favorite episodes': 30182,
'channels': 30173
}
label = lang(labels[tagname])
@ -349,6 +350,9 @@ class VideoNodes(object):
if itemtype == "channels":
root = self.commonRoot(order=1, label=label, tagname=tagname, roottype=2)
etree.SubElement(root, 'path').text = "plugin://plugin.video.emby/?id=0&mode=channels"
elif itemtype == "favourites" and mediatype == "episodes":
root = self.commonRoot(order=1, label=label, tagname=tagname, roottype=2)
etree.SubElement(root, 'path').text = "plugin://plugin.video.emby/?id=%s&mode=browsecontent&type=%s&folderid=favepisodes" %(tagname, mediatype)
else:
root = self.commonRoot(order=1, label=label, tagname=tagname)
etree.SubElement(root, 'order', {'direction': "ascending"}).text = "sorttitle"