diff options
author | pietje666 <martijn.moreel@gmail.com> | 2017-08-07 00:22:30 +0200 |
---|---|---|
committer | enen92 <enen92@users.noreply.github.com> | 2017-08-06 23:22:30 +0100 |
commit | 167f8398ca771605df09d761b6fee4662b40e66a (patch) | |
tree | c2482465dd1e5c977b1f28eb2294daafae3d58e7 /plugin.video.vrt.nu | |
parent | bae416886485536d991efe71b1f0af9449928748 (diff) |
[plugin.video.vrt.nu] 0.0.6 (#1361)
Diffstat (limited to 'plugin.video.vrt.nu')
-rw-r--r-- | plugin.video.vrt.nu/addon.py | 14 | ||||
-rw-r--r-- | plugin.video.vrt.nu/addon.xml | 6 | ||||
-rw-r--r-- | plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py | 10 | ||||
-rw-r--r-- | plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py | 1 |
4 files changed, 19 insertions, 12 deletions
diff --git a/plugin.video.vrt.nu/addon.py b/plugin.video.vrt.nu/addon.py index 0cd1b36..dbeec3d 100644 --- a/plugin.video.vrt.nu/addon.py +++ b/plugin.video.vrt.nu/addon.py @@ -1,12 +1,10 @@ import sys import xbmcaddon -import os -import requests from urlparse import parse_qsl from resources.lib.vrtplayer import vrtplayer from resources.lib.kodiwrappers import kodiwrapper from resources.lib.vrtplayer import actions -from resources.lib.helperobjects import helperobjects +from resources.lib.kodiwrappers import sortmethod _addon_ = xbmcaddon.Addon() _url = sys.argv[0] @@ -19,21 +17,21 @@ def router(params_string): params = dict(parse_qsl(params_string)) if params: if params['action'] == actions.LISTING_AZ: - kodi_wrapper.show_listing(vrt_player.get_az_menu_items()) + kodi_wrapper.show_listing(vrt_player.get_az_menu_items(), sortmethod.ALPHABET) elif params['action'] == actions.LISTING_CATEGORIES: - kodi_wrapper.show_listing(vrt_player.get_category_menu_items()) + kodi_wrapper.show_listing(vrt_player.get_category_menu_items(), sortmethod.ALPHABET) elif params['action'] == actions.LISTING_LIVE: - kodi_wrapper.show_listing(vrt_player.get_livestream_items()) + kodi_wrapper.show_listing(vrt_player.get_livestream_items(), sortmethod.ALPHABET) elif params['action'] == actions.LISTING_VIDEOS: kodi_wrapper.show_listing(vrt_player.get_videos(params['video'])) elif params['action'] == actions.LISTING_CATEGORY_VIDEOS: - kodi_wrapper.show_listing(vrt_player.get_video_category_episodes(params['video'])) + kodi_wrapper.show_listing(vrt_player.get_video_category_episodes(params['video']), sortmethod.ALPHABET) elif params['action'] == actions.PLAY: kodi_wrapper.play_video(params['video']) elif params['action'] == actions.PLAY_LIVE: kodi_wrapper.play_livestream(params['video']) else: - kodi_wrapper.show_listing(vrt_player.get_main_menu_items()) + kodi_wrapper.show_listing(vrt_player.get_main_menu_items(), sortmethod.ALPHABET) if __name__ == '__main__': router(sys.argv[2][1:]) diff --git a/plugin.video.vrt.nu/addon.xml b/plugin.video.vrt.nu/addon.xml index 29fbf79..ba64b5a 100644 --- a/plugin.video.vrt.nu/addon.xml +++ b/plugin.video.vrt.nu/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="plugin.video.vrt.nu" name="VRT Nu" - version="0.0.5" + version="0.0.6" provider-name="Martijn Moreel"> <requires> @@ -34,7 +34,9 @@ v0.0.4 (20-07-2017) - Added dates to videos (Thanks stevenv) - Fixed bug where seasons did not get listed v0.0.5 (24-07-2017) -- Fixed broken Sporza logo +- Fixed broken Sporza logo +v0.0.6 (06-08-2017) +- Fixed ordering bug for videos </news> <source>https://github.com/pietje666/plugin.video.vrt.nu</source> <assets> diff --git a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py index 588da79..c2df058 100644 --- a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py +++ b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py @@ -4,6 +4,7 @@ import xbmcplugin from urllib import urlencode from resources.lib.vrtplayer import vrtplayer from resources.lib.vrtplayer import urltostreamservice +from resources.lib.kodiwrappers import sortmethod class KodiWrapper: @@ -12,7 +13,7 @@ class KodiWrapper: self._url = url self._addon = addon - def show_listing(self, list_items): + def show_listing(self, list_items, sort=None): listing = [] for title_item in list_items: list_item = xbmcgui.ListItem(label=title_item.title) @@ -26,7 +27,12 @@ class KodiWrapper: listing.append((url, list_item, not title_item.is_playable)) xbmcplugin.addDirectoryItems(self._handle, listing, len(listing)) - xbmcplugin.addSortMethod(self._handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE) + + if sort is not None: + kodi_sorts = {sortmethod.ALPHABET: xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE} + kodi_sortmethod = kodi_sorts.get(sort) + xbmcplugin.addSortMethod(self._handle, kodi_sortmethod) + xbmcplugin.endOfDirectory(self._handle) def play_video(self, path): diff --git a/plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py b/plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py new file mode 100644 index 0000000..5ef8135 --- /dev/null +++ b/plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py @@ -0,0 +1 @@ +ALPHABET = 1 |