aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Converter/MovieInfo.py
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-08-06 22:39:50 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-08-06 22:39:50 +0000
commit5e0d91a196bfe872d04d676e5f6c2d5940786be0 (patch)
treec80fe3786f7f78a835582ff90fd26552d9ee11c8 /lib/python/Components/Converter/MovieInfo.py
parent254ae3154f5a26b9b58407fe9ff66aa6eb1131b7 (diff)
downloadenigma2-5e0d91a196bfe872d04d676e5f6c2d5940786be0.tar.gz
enigma2-5e0d91a196bfe872d04d676e5f6c2d5940786be0.zip
add possibility to select between different list styles via context menu
add possibility to sort the movielist by record time or alphanumeric add possibility to show detailed information about current selected movie thx to ralfk
Diffstat (limited to 'lib/python/Components/Converter/MovieInfo.py')
-rw-r--r--lib/python/Components/Converter/MovieInfo.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py
new file mode 100644
index 00000000..068d24d3
--- /dev/null
+++ b/lib/python/Components/Converter/MovieInfo.py
@@ -0,0 +1,42 @@
+from Components.Converter.Converter import Converter
+from Components.Element import cached
+from enigma import iServiceInformation
+from ServiceReference import ServiceReference
+
+class MovieInfo(Converter, object):
+ MOVIE_SHORT_DESCRIPTION = 0 # meta description when available.. when not .eit short description
+ MOVIE_META_DESCRIPTION = 1 # just meta description when available
+ MOVIE_REC_SERVICE_NAME = 2 # name of recording service
+
+ def __init__(self, type):
+ if type == "ShortDescription":
+ self.type = self.MOVIE_SHORT_DESCRIPTION
+ elif type == "MetaDescription":
+ self.type = self.MOVIE_META_DESCRIPTION
+ elif type == "RecordServiceName":
+ self.type = self.MOVIE_REC_SERVICE_NAME
+ else:
+ raise str("'%s' is not <ShortDescription|MetaDescription|RecordServiceName> for MovieInfo converter" % type)
+ Converter.__init__(self, type)
+
+ @cached
+ def getText(self):
+ service = self.source.service
+ info = self.source.info
+ if info and service:
+ if self.type == self.MOVIE_SHORT_DESCRIPTION:
+ event = self.source.event
+ if event:
+ descr = info.getInfoString(service, iServiceInformation.sDescription)
+ if descr == "":
+ return event.getShortDescription()
+ else:
+ return descr
+ elif self.type == self.MOVIE_META_DESCRIPTION:
+ return info.getInfoString(service, iServiceInformation.sDescription)
+ elif self.type == self.MOVIE_REC_SERVICE_NAME:
+ rec_ref_str = info.getInfoString(service, iServiceInformation.sServiceref)
+ return ServiceReference(rec_ref_str).getServiceName()
+ return ""
+
+ text = property(getText)