aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-01-13 20:35:28 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-01-13 20:35:28 +0000
commit55c37c32a8e3545266d50af73457e9e53932f3de (patch)
tree2b437f3c8c4fe18c1c1b2e3bb77081beb50b529b /lib/python
parent5d26224540dac9315066c52dc37197dbc8e0b24e (diff)
downloadenigma2-55c37c32a8e3545266d50af73457e9e53932f3de.tar.gz
enigma2-55c37c32a8e3545266d50af73457e9e53932f3de.zip
sort movie list
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/MovieList.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/python/Components/MovieList.py b/lib/python/Components/MovieList.py
index ff047225..25c32b66 100644
--- a/lib/python/Components/MovieList.py
+++ b/lib/python/Components/MovieList.py
@@ -25,8 +25,6 @@ RT_WRAP = 32
# | name of movie |
#
def MovieListEntry(serviceref, serviceHandler):
- res = [ serviceref ]
-
info = serviceHandler.info(serviceref)
if info is None:
@@ -39,11 +37,13 @@ def MovieListEntry(serviceref, serviceHandler):
else:
len = "?:??"
+ begin = info.getInfo(serviceref, iServiceInformation.sTimeCreate)
+ res = [ (serviceref, begin) ]
+
res.append((0, 0, 0, 560, 30, 0, RT_HALIGN_LEFT, info.getName(serviceref)))
description = info.getInfoString(serviceref, iServiceInformation.sDescription)
- begin = info.getInfo(serviceref, iServiceInformation.sTimeCreate)
-
+
begin_string = ""
if begin > 0:
t = FuzzyTime(begin)
@@ -71,7 +71,7 @@ class MovieList(HTMLComponent, GUIComponent):
return self.instance.getCurrentIndex()
def getCurrent(self):
- return self.l.getCurrentSelection()
+ return self.l.getCurrentSelection()[0]
def GUIcreate(self, parent):
self.instance = eListbox(parent)
@@ -113,12 +113,14 @@ class MovieList(HTMLComponent, GUIComponent):
# now process them...
for ref in movieList:
self.list.append(MovieListEntry(ref, serviceHandler))
-
+
+ self.list.sort(key=lambda x: -x[0][1])
+
def moveTo(self, serviceref):
found = 0
count = 0
for x in self.list:
- if str(ServiceReference(x[0])) == str(ServiceReference(serviceref)):
+ if str(ServiceReference(x[0][0])) == str(ServiceReference(serviceref)):
found = count
count += 1
self.instance.moveSelectionTo(found)