Skip to content

Commit

Permalink
Add more appropriate content to menu listing (#81)
Browse files Browse the repository at this point in the history
This PR changes the content of the menu listings so that the directory listing menu fits better with the content shown.
  • Loading branch information
dagwieers authored Mar 21, 2019
1 parent 22d43e4 commit 14ec2bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, handle, url, addon):
self._url = url
self._addon = addon

def show_listing(self, list_items, sort=None):
def show_listing(self, list_items, sort=None, content_type='episodes'):
listing = []
for title_item in list_items:
list_item = xbmcgui.ListItem(label=title_item.title)
Expand All @@ -47,7 +47,7 @@ def show_listing(self, list_items, sort=None):
else:
xbmcplugin.addSortMethod(self._handle, xbmcplugin.SORT_METHOD_NONE)

xbmcplugin.setContent(int(self._handle), "episodes")
xbmcplugin.setContent(int(self._handle), content_type)
xbmcplugin.endOfDirectory(self._handle)

def play(self, video):
Expand Down
10 changes: 5 additions & 5 deletions plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ def show_main_menu_items(self):
'DefaultYear.png',
dict(plot=self._kodi_wrapper.get_localized_string(32087))),
]
self._kodi_wrapper.show_listing(menu_items)
self._kodi_wrapper.show_listing(menu_items, content_type='files')

def show_tvshow_menu_items(self, path):
menu_items = self._api_helper.get_tvshow_items(path)
self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET, content_type='tvshows')

def show_category_menu_items(self):
joined_url = ''.join((self.VRTNU_BASE_URL, '/categorieen/'))
menu_items = self.__get_category_menu_items(joined_url, {'class': 'nui-tile title'}, actions.LISTING_CATEGORY_TVSHOWS)
self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
self._kodi_wrapper.show_listing(menu_items, sort=sortmethod.ALPHABET, content_type='files')

def play(self, video):
stream = self._stream_service.get_stream(video)
Expand All @@ -74,11 +74,11 @@ def show_livestream_items(self):
True, self._api_helper.get_live_screenshot('ketnet'),
dict(plot=self._kodi_wrapper.get_localized_string(32103))),
]
self._kodi_wrapper.show_listing(livestream_items)
self._kodi_wrapper.show_listing(livestream_items, content_type='videos')

def show_episodes(self, path):
title_items, sort = self._api_helper.get_episode_items(path)
self._kodi_wrapper.show_listing(title_items, sort=sort)
self._kodi_wrapper.show_listing(title_items, sort=sort, content_type='episodes')

def __get_category_menu_items(self, url, soupstrainer_parser_selector, routing_action, video_dictionary_action=None):
response = requests.get(url)
Expand Down

0 comments on commit 14ec2bb

Please sign in to comment.