summaryrefslogtreecommitdiff
path: root/plugin.video.vrt.nu/resources
diff options
context:
space:
mode:
authorpietje666 <martijn.moreel@gmail.com>2017-08-07 00:22:30 +0200
committerenen92 <enen92@users.noreply.github.com>2017-08-06 23:22:30 +0100
commit167f8398ca771605df09d761b6fee4662b40e66a (patch)
treec2482465dd1e5c977b1f28eb2294daafae3d58e7 /plugin.video.vrt.nu/resources
parentbae416886485536d991efe71b1f0af9449928748 (diff)
[plugin.video.vrt.nu] 0.0.6 (#1361)
Diffstat (limited to 'plugin.video.vrt.nu/resources')
-rw-r--r--plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py10
-rw-r--r--plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py1
2 files changed, 9 insertions, 2 deletions
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