move the movie selector to the currently playing movie
[enigma2.git] / lib / python / Components / MovieList.py
index 7121772c69922e5c471cd3cffd1f6094a1b033e2..3c5f7e24a7022e35c2a1e68e4d120ebc8aebf204 100644 (file)
@@ -1,6 +1,7 @@
 from HTMLComponent import *
 from GUIComponent import *
 from Tools.FuzzyDate import FuzzyTime
+from ServiceReference import ServiceReference
 
 from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation
 
@@ -105,6 +106,15 @@ class MovieList(HTMLComponent, GUIComponent):
                # now process them...
                for ref in movieList:
                        self.list.append(MovieListEntry(ref, serviceHandler))
+                       
+       def moveTo(self, serviceref):
+               found = 0
+               count = 0
+               for x in self.list:
+                       if str(ServiceReference(x[0])) == str(ServiceReference(serviceref)):
+                               found = count
+                       count += 1
+               self.instance.moveSelectionTo(found)
 
        def reload(self):
                self.load(self.root)